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