'添加块定义
5 L7 G" _; @3 j3 N5 i; q5 h6 \4 gDim blkDef As AcadBlock/ u( X0 Y0 k- H. x
Set blkDef = ThisDrawing.Blocks.Add(BasePoint, "*U"), k0 }5 e& R$ M' \1 x D% q
'向块中增加多段线, V4 ^" E! ~5 P" X' @9 {! B4 ^
Dim LineObject As AcadLWPolyline
. [# I8 _0 m2 vSet LineObject = blkDef.AddLightWeightPolyline(LineVerts) '画多段线
- s+ p" K' F$ n'增加10dB/10m属性
& h+ C; B! V8 q; T3 D" U) r7 zDim attributeObj As AcadAttribute$ J8 ~% C5 U( b7 o
Dim DbBasePoint(0 To 2) As Double R4 s% L7 X: x2 X5 w* G) v
DbBasePoint(0) = LineTextPoint(0): DbBasePoint(1) = LineTextPoint(1): DbBasePoint(2) = 03 O/ P# R) i# Q
DbRoation = LineTextPoint(2)$ t; r" `& i$ g
Set attributeObj = blkDef.AddAttribute(ThisDrawing.ActiveTextStyle.Height, acAttributeModeNormal, "插入馈线损耗", DbBasePoint, "馈线损耗", LineDb) P/ ?1 g/ R) M6 y
attributeObj.alignment = acAlignmentBottomCenter '底部中心点 ]; X6 a7 {1 T% }, J5 M
attributeObj.TextAlignmentPoint = DbBasePoint '重定义对齐点! |2 U( X7 u) _3 R0 i& ?5 R6 I
( m/ j/ V6 |3 E* w1 U8 S
运行该程序后,插入该块,块的属性,应该距离线40mm,但却离开的很远。
# j. v6 _8 D* I n$ E但插入一个,在autocad界面拉动块的属性后,就正常了,思考了变天,不知道咋回事,+ a& k% h9 N8 N- `
大侠,帮忙啊 |