请教VBA 中使用CopyObjects复制CAD出错
sub test
Dim doc As AcadDocument, docA3 As AcadDocument
DimssetObjA3 As AcadSelectionSet, DestCopyAs AcadSelectionSet
Set docA3 = acadApp.Documents.Open(Sheets(Sn).Cells(4, 3).Value)
With docA3.SelectionSets
While .count > 0
.Item(0).Delete
Wend
End With
Set ssetObjA3 = docA3.SelectionSets.Add("tukuangA3")
'省略给PtMina3, PtMaxa3赋值
docA3.Application.ZoomExtents
ssetObjA3.Select acSelectionSetWindow, PtMina3, PtMaxa3
Set doc = acadApp.Documents.Open(Sheets(Sn).Cells(5, 3).Value)
Set DestCopy = docA3.CopyObjects(ssetObjA3, doc.ModelSpace) ‘出错,INVALID OBJECT ARRAY’
。。。。。。。
end sub
如果将ssetObjA3改成AcadEntity数组能够通过,但是DestCopy不匹配,请教该怎么处理?
返回值也是数组
页:
[1]