使用下面的代码建立了一个图纸空间后,怎样加载一个例如文件名是 d:/drawing.vlx 的程序。
Private AcadApp1Mdl As Object Private AcadDoc1Mdl As Object Private MoSpace1Mdl As Object Private PaSpace1Mdl As Object Private Sub OpenDrawModel() Dim ProcID As Integer ProcID = Shell("C:\Program Files\AutoCAD 2002\acad.exe e:/cad工程/qty25/图符/qty25模板.dwg ", AppWinStyle.NormalFocus)
AcadApp1Mdl = GetObject(, "AutoCAD.Application") If Err.Number <> 0 Then Err.Clear() AcadApp1Mdl = CreateObject("AutoCAD.Application") If Err.Number <> 0 Then MsgBox(Err.Description) Exit Sub End If End If
AcadApp1Mdl.Visible = True AcadDoc1Mdl = AcadApp1Mdl.ActiveDocument MoSpace1Mdl = AcadDoc1Mdl.ModelSpace PaSpace1Mdl = AcadDoc1Mdl.PaperSpace
End Sub