NewDrawing Event In VB.NET With AutoCAD

Discussion in 'AutoCAD' started by willemschwarte, Aug 11, 2003.

  1. Hi,

    I was wondering how this event works, or maybe, I should use another event....

    I have an active acadapplication variable. what i want to do is the following:

    When a user creates a new drawing. I want to catch that event and rename the drawing and save it this way. Seems simple, but when i put (something like) this in the NEW Drawign event AUTOCAD throws a exception...

    newdrawingEVENT
    --
    myAutocadApp.activedocument.saveas("Test.DWG")

    well i guess this throws the exception.

    Where should i put this code to get this to work?
     
    willemschwarte, Aug 11, 2003
    #1
  2. AutoCAD will not allow you to save a drawing with the same name as another drawing that is already open. Could that be source of your error?
     
    Mark_Abercrombie, Aug 11, 2003
    #2
  3. That I can tell vb does not catch the new drawing.



    Maybe if you loop through all open docs and do a if then statement to see if the drawing name starts with mid(Acad_doc.name,1,7)="Drawing" then continue with the routine.



     



    Andy



     



    ...

    Hi,

    I was wondering how this event works, or maybe, I should use another event....

    I have an active acadapplication variable. what i want to do is the following:

    When a user creates a new drawing. I want to catch that event and rename the drawing and save it this way. Seems simple, but when i put (something like) this in the NEW Drawign event AUTOCAD throws a exception...

    newdrawingEVENT
    --
    myAutocadApp.activedocument.saveas("Test.DWG")

    well i guess this throws the exception.

    Where should i put this code to get this to work?
     
    Andrew Elmore, Aug 11, 2003
    #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.