'添加块定义/ M- v2 r- J9 G
Dim blkDef As AcadBlock
f4 ?, n+ j E# R6 Q* i6 ]Set blkDef = ThisDrawing.Blocks.Add(BasePoint, "*U")
8 F& y+ I# M2 t3 D3 t4 x. p& l'向块中增加多段线% V" \8 r0 ^/ C/ h2 y8 S# A9 n5 {
Dim LineObject As AcadLWPolyline# {5 E- A$ ]9 O! L8 H% A& E. ^8 [- }7 P
Set LineObject = blkDef.AddLightWeightPolyline(LineVerts) '画多段线
9 g0 a' M; \% G6 k'增加10dB/10m属性
+ O; U* j$ m# N5 xDim attributeObj As AcadAttribute
% \# J Y" [) o" D2 d( U& P4 N. ]Dim DbBasePoint(0 To 2) As Double
9 p. K# E3 o8 i* g1 y1 S& D4 O: LDbBasePoint(0) = LineTextPoint(0): DbBasePoint(1) = LineTextPoint(1): DbBasePoint(2) = 0% |& O5 f1 N9 i* f+ H/ x+ f$ J2 @, e
DbRoation = LineTextPoint(2)
4 ~- t/ X& E3 ]: `: I. lSet attributeObj = blkDef.AddAttribute(ThisDrawing.ActiveTextStyle.Height, acAttributeModeNormal, "插入馈线损耗", DbBasePoint, "馈线损耗", LineDb)) ^, [4 y6 U( N& n5 S7 A4 h
attributeObj.alignment = acAlignmentBottomCenter '底部中心点
. F! A4 k& x h: W. x3 e# g* LattributeObj.TextAlignmentPoint = DbBasePoint '重定义对齐点9 a5 N' }5 a7 o
- ]- N! N; y3 g& b$ U$ z4 n! i3 s
运行该程序后,插入该块,块的属性,应该距离线40mm,但却离开的很远。" j: Q0 ^( M/ {4 c6 ^ `5 B
但插入一个,在autocad界面拉动块的属性后,就正常了,思考了变天,不知道咋回事,
4 E& C: U ~* Z: e8 f! ~大侠,帮忙啊 |