- 积分
- 386
- 明经币
- 个
- 注册时间
- 2005-1-20
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
Sub PrintModelSpace() On Error Resume Next Dim insert_x As Double, insert_y As Double, xscl As Single Dim FilterType(0) As Integer Dim FilterData(0) As Variant Dim ii As Integer Dim attributeobj As AcadAttribute Dim obj As AcadBlockReference Dim var As Variant FilterType(0) = 2 FilterData(0) = "tk" Dim sel As AcadSelectionSet '选择集 Set sel = ThisDrawing.SelectionSets.Add("ssel") If Err Then Err.Clear ThisDrawing.SelectionSets("ssel").Delete Set sel = ThisDrawing.SelectionSets.Add("ssel") End If sel.Select acSelectionSetAll, , , FilterType, FilterData For ii = 1 To sel.Count Set obj = sel.Item(ii) insert_x = obj.InsertionPoint(0) insert_y = obj.InsertionPoint(1) xscl = obj.XScaleFactor Next ii End Sub
以上程序是想在图中选择块名为tk的块,然后分别获得每个块的插入点和X比例,但是只能得到第一个块名为tk的插入点和X比例,为什么?有没有人能帮帮我??
|
|