补充 Visual basic 6.0 关于控制AutoCAD启动指定文件的程序 50
PrivateSubCommand1_Click()DimAcadappAsObjectDimAcaddocAsObjectDimMospaceAsObjectOnErr...
Private Sub Command1_Click()Dim Acadapp As ObjectDim Acaddoc As ObjectDim Mospace As ObjectOn Error Resume NextSet Acadapp = GetObject("AutoCAD.application")If Err Then Err.Clear Set Acadapp = CreateObject("AutoCAD.application") If Err Then MsgBox Err.Description Exit Sub End IfEnd IfAcadapp.Visible = TrueSet Acaddoc = Acadapp.ActiveDocumentSet Mospace = Acaddoc.ModelSpaceAcadapp.Top = 100Acadapp.Left = 200Acadapp.Height = 1000Acadapp.Width = 800Acadapp.Caption = "AutoCAD启动程序"Dim CadlX As StringCadlX = "C:\001.dwg"If Dir(CadlX) <> "" Then Acaddoc.Open CadlXElse Acaddoc.New ("acad")End IfEnd Sub以上可以打开AutoCAD,但是打不开C:\001.dwg,请高手帮忙
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询