- 积分
- 1055
- 明经币
- 个
- 注册时间
- 2002-11-26
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-4-20 09:22:00
|
显示全部楼层
我的关于插入属性块的程序。
Sub lhjc()
Dim blockA00 As String
Dim insertpoint As Variant
ThisDrawing.ActiveTextStyle.BigFontFile = "D:\Program Files\AutoCAD 2002\Fonts\Hztxtg.shx"
ThisDrawing.ActiveTextStyle.fontFile = "D:\Program Files\AutoCAD 2002\Fonts\italic.shx"
On Error Resume Next
insertpoint = ThisDrawing.Utility.GetPoint(, "请输入插入点:")
blockA00 = "D:\Program Files\AutoCAD 2002\design\att\tukuang\A00.dwg"
If Err Then
Err.Clear
Exit Sub
End If
Dim blockobjA00 As AcadBlockReference
Set blockobjA00 = ThisDrawing.ModelSpace.InsertBlock(insertpoint, blockA00, 1, 1, 1, 0)
ThisDrawing.SendCommand "attedit" & vbCrLf & "(entlast)" & vbCr
If blockobjA00.Layer = "图幅" Then
Exit Sub
Else:
Set tukuang = ThisDrawing.Layers.Add("图幅")
blockobjA00.Layer = "图幅"
End If
ZoomAll
End Sub
我的是先做个属性块,然后插入它,并调用ate命令来修改,根据我的经验,属性块中属性文字的位置和文字添加时或修改时的先后顺序有关。 |
|