aaApi_OpenDocument does not work for existing Autocad instance

Hi,

I am trying to open a document which I created in PW through PW programming. 

Basically I have design a command in Autocad which calls my PW wrapper which in turn creates a new document.

I am trying to open the new created document by using aaApi_OpenDocument.

If I am using standalone exe , the document is created and open will open the document in autocad (new instance of autocad)

However when I launch the command in autocad (dll) which in turn calls my PW wrapper to open the document , the call to aaApi_OpenDocument freeze and then I have to use Task manager to end the program.

Reuse of existing open Autocad instance leds to problem.

I tried opening the new document by double clicking and it works.

Can anyone guide me on this?

Thank you.

Rashmi.

  • Try this

    1. make sure your AutoCAD is in MDI (multi document interface)  = 1

    2. use the PW API to check out the document, The call to the function will fill out the local path in the variable sent to the function.

    3. once the document is checked out, use AutoCAD to open the document in the current session rather than telling Windows to open the document.

    4. in Auotcad code "on document close" you can optionally check the document in using the PW wrapper.

    You can do the same above with Copy out and Purge if you don't want to check out the document.

  • Thank you for the input.

    I did created the document in Autocad and saved it in PW , rather than creating document in PW and opening in Autocad and got it to work. In this way I do not have to care for free / checkin the document, PW integration does it for me.

    I could not make it work other way round create document in PW and open from PW in Autocad if Autocad is already in session. 

    Thank you.