'添加块定义; N3 ?/ P7 \5 H( ?* l
Dim blkDef As AcadBlock+ n. o9 W! q$ s D0 k
Set blkDef = ThisDrawing.Blocks.Add(BasePoint, "*U")! z$ K1 l* v; N0 w: I/ T
'向块中增加多段线 T3 @9 P$ Q- I, s; A
Dim LineObject As AcadLWPolyline
* n& [, [$ d8 ]( f0 o w7 f5 ASet LineObject = blkDef.AddLightWeightPolyline(LineVerts) '画多段线
4 H( l' B! f. B& R" D'增加10dB/10m属性* c1 V" V' @! l
Dim attributeObj As AcadAttribute# O; R, V4 I" d9 m
Dim DbBasePoint(0 To 2) As Double+ L- X( C" ?( B6 ~% J3 v/ a
DbBasePoint(0) = LineTextPoint(0): DbBasePoint(1) = LineTextPoint(1): DbBasePoint(2) = 0* n! T8 Q; }+ D4 U
DbRoation = LineTextPoint(2)4 Q0 H a. n* X9 T- s
Set attributeObj = blkDef.AddAttribute(ThisDrawing.ActiveTextStyle.Height, acAttributeModeNormal, "插入馈线损耗", DbBasePoint, "馈线损耗", LineDb)' j! Y) ? m D( v9 V/ L6 b3 W
attributeObj.alignment = acAlignmentBottomCenter '底部中心点
6 q e8 h( K8 S. ^attributeObj.TextAlignmentPoint = DbBasePoint '重定义对齐点
K% {2 j, N5 ^' _% ?- I0 f; q8 X
& D/ u$ C9 M# v9 _" c2 |, Z运行该程序后,插入该块,块的属性,应该距离线40mm,但却离开的很远。
y v2 j" u+ H3 M/ T2 ~但插入一个,在autocad界面拉动块的属性后,就正常了,思考了变天,不知道咋回事,% v- m* X. |7 [; @& Q; X0 Y4 ^4 ?8 O
大侠,帮忙啊 |