Hi gary lee,![]()
Welcome to VBAX![]()
When posting code use the vba tags it will display the code as if it was in the vbaide
Dim AcadApp as Acadapplication Dim MyDwg as AcadDocument Dim DWG as string ' file path Set AcadApp = GetObject(, "AutoCAD.Application") Set MyDwg = AcadApp.Documents.Open(DWG) '<- the DWG should contain "C:\acad\somedrawing.dwg"
The way I use it
Public Graphics As AcadApplication Public Sub OpnAcad() Dim AngBracDwg As String Set Graphics = GetObject(, "AutoCAD.Application") If Err.Description > vbNullString Then Err.Clear Set Graphics = CreateObject("AutoCAD.Application") End If AngBracDwg = "c:\dwg\ba1.dwg" Graphics.Documents.Open (AngBracDwg) End Sub
Let me know if more assistance is needed.





Reply With Quote