Opening Drawings in AutoDesk Map 2005

Discussion in 'AutoCAD' started by jimmilam, Jun 17, 2004.

  1. jimmilam

    jimmilam Guest

    We've got VBA macros that we've used for several years to manage our drawings (with both AutoCAD and AutoDesk Map). The macros basically open and close a large amount of drawings and extract or change attribute information. The GetObject function is used to open drawings (i.e. - Set AcadDoc = GetObject(FileName)). The macros work fine with AutoCAD 2005, but not with AutoDesk Map 2005. With Map 2005 every time the GetObject function is used to open a drawing, first a temporary drawing (called Drawing1.dwg, Drawing2.dwg, etc) is created, closed, and then the desired drawing is opened. Everytime a temporary drawing is closed a dialog box asking "Save changes to Drawing1.dwg?" is displayed. Macro execution then stops until a user responds to the dialog box.
    Has anybody else run across this, and is there a fix?
     
    jimmilam, Jun 17, 2004
    #1
  2. jimmilam

    jimmilam Guest

    Just a little more information - In looking at previous postings I found a similar problem a user was having with ACAD 2002 (GetObject(strDwgName) (6 replies), Posted by: Mark Propst, Date: Mar/13/04 - 17:30 (GMT))
     
    jimmilam, Jun 21, 2004
    #2
  3. jimmilam

    jimmilam Guest

    A code change was made which gives a workable solution (i.e. a dialog box pops up on the first drawing, but not on subsequent drawings). Previously each drawing was opened with
    Set AcadDoc = GetObject(FileNm)

    The new code opens drawings with
    On Error Resume Next
    Set AcadDoc = AcadApp.Documents.Open(FileNm)
    If Err Then
    Err.Clear ' Clear the error if it exists
    Set AcadDoc = GetObject(FileNm)
    Set AcadApp = AcadDoc.Application
    End If
     
    jimmilam, Jun 22, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.