+ Reply to Thread
Results 1 to 7 of 7

Thread: AutoCAD VBA

  1. #1
    Forum Newbie
    Using
    AutoCAD 2007
    Join Date
    Apr 2010
    Posts
    8

    Default AutoCAD VBA

    Registered forum members do not see this ad.

    I'm trying to run some code from AutoCAD 2006 in AutoCAD 2011 but it's failing on the thisdrawing.open

    Code:
     
    Sub main()
    ThisDrawing.Open "C:\CGP1-L-099-PI1-93327-09.DWG"
    End Sub
    Run-time error '-2145386445 (80200033)':

    Filer error


    Has anyone ever come across this? I've been putting off rewriting this in .NET....

    Thanks

  2. #2
    Senior Member Jeff H's Avatar
    Using
    MEP 2011
    Join Date
    Oct 2010
    Posts
    177

    Default

    See if this helps
    Go here at http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html
    This is the AutoCAD .NET Developers guide but at the bottom of the page expand the VBA/ActiveX Code reference

  3. #3
    Forum Deity Jack_O'neill's Avatar
    Computer Details
    Jack_O'neill's Computer Details
    Operating System:
    xp
    Discipline
    Architectural
    Jack_O'neill's Discipline Details
    Discipline
    Architectural
    Details
    The bulk of my business is commercial curtainwall, site plans and floor plans. I do occasionally get a bit of tool and die, and the odd house now and again.
    Using
    AutoCAD 2010
    Join Date
    Sep 2008
    Location
    lost in the Arkansas wilderness
    Posts
    2,146

    Default

    I've never looked at 2011, but for 2010 there was a vba something or other that you had to download to get it to work. Same for 2011 maybe?
    Never try to teach a pig to sing. It wastes your time and annoys the pig. -Robert Heinlein

  4. #4
    Forum Newbie
    Using
    AutoCAD 2007
    Join Date
    Apr 2010
    Posts
    8

    Default

    I've already downloaded and installed the vba enabler for AutoCAD 2011.

    Thanks

  5. #5
    Senior Member Jeff H's Avatar
    Using
    MEP 2011
    Join Date
    Oct 2010
    Posts
    177

    Default

    It is not posting right
    so go to http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html

    and at the bottom expand the VBA/ACTIVEx node
    Last edited by Jeff H; 15th Oct 2010 at 03:48 pm. Reason: cv

  6. #6
    Senior Member Jeff H's Avatar
    Using
    MEP 2011
    Join Date
    Oct 2010
    Posts
    177

    Default

    Try
    Dim dwgName As String
    dwgName = "c:\Whatever.dwg"
    ThisDrawing.Application.Documents.Open dwgName

  7. #7
    Forum Deity Jack_O'neill's Avatar
    Computer Details
    Jack_O'neill's Computer Details
    Operating System:
    xp
    Discipline
    Architectural
    Jack_O'neill's Discipline Details
    Discipline
    Architectural
    Details
    The bulk of my business is commercial curtainwall, site plans and floor plans. I do occasionally get a bit of tool and die, and the odd house now and again.
    Using
    AutoCAD 2010
    Join Date
    Sep 2008
    Location
    lost in the Arkansas wilderness
    Posts
    2,146

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by sdubbs View Post
    I've already downloaded and installed the vba enabler for AutoCAD 2011.

    Thanks
    Figured you probably had, but hey, sometimes the obvious is the first thing overlooked.
    Never try to teach a pig to sing. It wastes your time and annoys the pig. -Robert Heinlein

Similar Threads

  1. Google Earth Extension for AutoCAD 2007, AutoCAD 2008, and AutoCAD 2009
    By Between the Lines in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 22nd Apr 2008, 11:00 pm

Bookmarks

Posting Permissions

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