'添加块定义
: M5 K/ M ` E; a- HDim blkDef As AcadBlock
$ `$ t, B7 N$ Z* ~1 tSet blkDef = ThisDrawing.Blocks.Add(BasePoint, "*U")
- c) c8 O7 G6 y! H' n$ ~'向块中增加多段线
& E/ p$ Z) Z- N" `, mDim LineObject As AcadLWPolyline
/ ]( q/ T: m$ ~/ nSet LineObject = blkDef.AddLightWeightPolyline(LineVerts) '画多段线
; U" ?0 y6 b% U'增加10dB/10m属性/ {9 a+ Z% p# w: n
Dim attributeObj As AcadAttribute
" F8 G9 g& Z- Q" e. |Dim DbBasePoint(0 To 2) As Double- J7 t5 h- g) E
DbBasePoint(0) = LineTextPoint(0): DbBasePoint(1) = LineTextPoint(1): DbBasePoint(2) = 02 m* @8 W2 G+ x. p2 y+ P
DbRoation = LineTextPoint(2)0 d( m; x' M3 L+ W y0 n
Set attributeObj = blkDef.AddAttribute(ThisDrawing.ActiveTextStyle.Height, acAttributeModeNormal, "插入馈线损耗", DbBasePoint, "馈线损耗", LineDb)
& V2 n4 _: G3 yattributeObj.alignment = acAlignmentBottomCenter '底部中心点
2 p# u+ m+ i" P6 E9 G9 S- V% TattributeObj.TextAlignmentPoint = DbBasePoint '重定义对齐点
8 Y6 ]3 G) D+ `. \! R8 G
Q$ h7 e' \4 n9 g' i- X/ d运行该程序后,插入该块,块的属性,应该距离线40mm,但却离开的很远。
: y5 z+ g6 G7 Q7 G! g+ R4 g但插入一个,在autocad界面拉动块的属性后,就正常了,思考了变天,不知道咋回事,
# R {& m P( g/ Q大侠,帮忙啊 |