- 积分
- 268
- 明经币
- 个
- 注册时间
- 2008-9-9
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
Sub aa()
Dim a As Object
Dim b As Object
Dim c As Object
Dim filterType(0) As Integer, filterData(0) As Variant
Dim sset As AcadSelectionSet
Set a = CreateObject("excel.application")
Set b = a.Workbooks.Add
Set c = b.Worksheets(1)
Set sset = ThisDrawing.SelectionSets.Item("ToExcel")
filterType(0) = 0
filterData(0) = "line,circle,point"
sset.SelectOnScreen filterType, filterData
c.Range("A1") = "ObjectCount" '写入标题
c.Range("B1") = sset.Count '写入数据
Dim Obj As AcadEntity, i As Long, varCP As Variant
i = 2
For Each Obj In sset
Select Case Obj.ObjectName
Case "AcDbLine"
c.Range(("A" & i)) = "111" '写入对象名
End Select
i = i + 1
Next
a.Visible = True
End Sub
|
|