CAD设计论坛

 找回密码
 立即注册
论坛新手常用操作帮助系统等待验证的用户请看获取社区币方法的说明新注册会员必读(必修)
查看: 1528|回复: 1

[求助] autocad 块插入属性不在设定的位置

[复制链接]
发表于 2010-4-9 15:01 | 显示全部楼层 |阅读模式
'添加块定义
& d2 e4 N! y1 G+ U- e7 B& q  bDim blkDef As AcadBlock+ w& G. J/ y, D. ?% V
Set blkDef = ThisDrawing.Blocks.Add(BasePoint, "*U")
  n" I* }/ ?+ C6 v, j3 ?; E'向块中增加多段线
+ P: f( R& A! L. G% }+ l% uDim LineObject As AcadLWPolyline
2 T8 s: n9 J1 f! i; nSet LineObject = blkDef.AddLightWeightPolyline(LineVerts)  '画多段线( X# l2 E. c1 d6 u/ b
'增加10dB/10m属性
; m3 _1 O* y8 L9 `Dim attributeObj As AcadAttribute+ K9 h# S) K  M
Dim DbBasePoint(0 To 2) As Double
8 g. w0 @% ^( x+ a7 ZDbBasePoint(0) = LineTextPoint(0): DbBasePoint(1) = LineTextPoint(1): DbBasePoint(2) = 0
  V* d1 i3 `8 |% C# p% pDbRoation = LineTextPoint(2)
/ Y. D* t$ Z5 C& a( k7 gSet attributeObj = blkDef.AddAttribute(ThisDrawing.ActiveTextStyle.Height, acAttributeModeNormal, "插入馈线损耗", DbBasePoint, "馈线损耗", LineDb); J3 O! l( y& w$ ^0 G7 b8 x
attributeObj.alignment = acAlignmentBottomCenter  '底部中心点
7 [: d8 P5 B# r& d% G1 PattributeObj.TextAlignmentPoint = DbBasePoint '重定义对齐点8 I$ F) y6 ~( K" y
8 ]# L9 C$ m* ^' {8 |# J
运行该程序后,插入该块,块的属性,应该距离线40mm,但却离开的很远。% k. k/ W3 R, w; e" Z
但插入一个,在autocad界面拉动块的属性后,就正常了,思考了变天,不知道咋回事,  D3 j" }- |+ @. N% J2 |+ T1 _" D
大侠,帮忙啊

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
发表于 2010-4-11 21:27 | 显示全部楼层
块属性的位置是不是你最开始设置的时候就没放好啊, @. ~: z9 }% H5 {! U8 [! w) c1 z
你看下块属性里面可以调整位置的
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关于|免责|隐私|版权|广告|联系|手机版|CAD设计论坛

GMT+8, 2025-11-22 14:15

CAD设计论坛,为工程师增加动力。

© 2005-2025 askcad.com. All rights reserved.

快速回复 返回顶部 返回列表