Consulting

Results 1 to 6 of 6

Thread: How to control AutoCad LT with Visual Basic 6

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location

    Wink How to control AutoCad LT with Visual Basic 6

    i have autocad2007 and autocad LT 2006 in my system i want to open dwg files in autccad Lt 2006 using vb.6 code.

    i want to modify the above code and open dwg drawings in Lt

    above code will open drawing in autocad2007


    Dim DwgName As String
            On Error Resume Next
            Set acadApp = GetObject(, "AutoCAD.Application")
    If Err Then
       Set acadApp = CreateObject("AutoCAD .Application")
       Err.Clear
            End If
    '        If Right(App.Path, 1) = "\" Then
       '            DwgName = "C:\13027167-GX2.dwg"
       '        Else
       '            DwgName = "C:\13027167-GX2.dwg"
    '        End If
            Set acadDoc = acadApp.ActiveDocument
            If acadDoc.FullName <> DwgName Then
       acadDoc.Open DwgName
            End If
            Dim str As String, str1 As String
            str1 = "_-insert" & vbLf & """" & "C:\14001120-AA8232-AC8232-AZ665.dwg" & """" & vbLf & "0,0,0" & vbLf & vbLf & vbLf & vbLf & "z" & vbLf & "a" & vbLf
            'str = "dwin" & vbLf
            acadDoc.SendCommand str1
           ' acadDoc.SendCommand str
    acadApp.Visible = True
    Last edited by Aussiebear; 04-11-2023 at 05:23 AM. Reason: Adjusted the code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •