- 积分
- 664
- 明经币
- 个
- 注册时间
- 2004-9-3
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2004-12-8 20:07:00
|
显示全部楼层
Dim acadapp As AcadApplication Dim acaddoc As AcadDocument '初始化CAD 'On Error Resume Next Set acadapp = GetObject(, "autocad.application.16") If Err Then Err.Clear Set acadapp = CreateObject("autocad.application.16") If Err Then MsgBox Err.Description Exit Sub End If End If Dim filepath As String filepath = "D:\Syq901\c0101-02.dwg" acadapp.Documents.Open (filepath) Set acaddoc = acadapp.ActiveDocument acadapp.Visible = False Dim ss As AcadSelectionSet MsgBox (acaddoc.SelectionSets.Count) 'acaddoc.SelectionSets("test").Delete ---此处报错?????? Set ss = acaddoc.SelectionSets.Add("Test") Dim ft(1) As Integer, fd(1) ft(0) = 0: fd(0) = "insert" 'ft(1) = 2: fd(1) = "fa,fb,fc" ss.Select acSelectionSetAll, ft, fd MsgBox ss.Count
结果还是ss.Count还是3000多,和没定义时一样多,选择了所有的,怎么回事? |
|