'添加块定义 ]% D, g( V1 ~0 ~. i5 ]- m$ |
Dim blkDef As AcadBlock+ l) z+ g2 s. S
Set blkDef = ThisDrawing.Blocks.Add(BasePoint, "*U")& [" I/ ^) `' z* o+ l
'向块中增加多段线. L- S! | Q/ [: v
Dim LineObject As AcadLWPolyline. E, w) O) J4 S0 l- W0 e) v$ M
Set LineObject = blkDef.AddLightWeightPolyline(LineVerts) '画多段线
# U3 F% E B% ~: o$ s'增加10dB/10m属性
! Q U# Y$ v2 |2 v: J, QDim attributeObj As AcadAttribute/ i5 k3 W2 i: c, s% @( O
Dim DbBasePoint(0 To 2) As Double
. y& v* _' `2 o& M* i$ e7 lDbBasePoint(0) = LineTextPoint(0): DbBasePoint(1) = LineTextPoint(1): DbBasePoint(2) = 05 T3 r' z8 e; ^- u: W7 U3 v
DbRoation = LineTextPoint(2)
* ~9 K& t9 E6 f, u% t0 jSet attributeObj = blkDef.AddAttribute(ThisDrawing.ActiveTextStyle.Height, acAttributeModeNormal, "插入馈线损耗", DbBasePoint, "馈线损耗", LineDb)- d, x/ ?6 F! \) o1 J5 M {" S) z
attributeObj.alignment = acAlignmentBottomCenter '底部中心点
+ K& ]& X P! G, E; |, wattributeObj.TextAlignmentPoint = DbBasePoint '重定义对齐点2 x9 Z6 v0 o0 T( ^8 Q- j# ]
2 O0 C- f- J7 M" g+ c运行该程序后,插入该块,块的属性,应该距离线40mm,但却离开的很远。; E" Z2 W, w4 E
但插入一个,在autocad界面拉动块的属性后,就正常了,思考了变天,不知道咋回事,
- p, z: i# o6 a" |& C* t4 l大侠,帮忙啊 |