On Error Resume Next
Dim tmCAD As AcadApplication
Set tmCAD = GetObject(, "AutoCAD.Application.16")
If Err Then
Err.Clear
Set tmCAD = CreateObject("AutoCAD.Application.16")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
tmCAD.Documents.Open "c:\123.dwg"
Set sSet = tmCAD.ActiveDocument.SelectionSets.Add("TEST")
tmCAD.ActiveDocument.SendCommand "_ai_selall" & Chr(13)
tmCAD.ActiveDocument.Export App.Path & "tempcad", "WMF", sSet
tmCAD.ActiveDocument.SelectionSets.Item("TEST").Delete
Picture1.Picture = LoadPicture(App.Path & "tempcad.wmf")
tmCAD.Documents.Close
tmCAD.Quit
Set tmCAD = Nothing
[[it] 本帖最后由 西风独自凉 于 2008-7-12 08:35 编辑 [/it]]