ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to open last saved DWG?

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
129 Views, 2 Replies

How to open last saved DWG?

Hi!
I want to open last saved DWG. Has anybody idea how to do this in ObjectARX?
My decision: 1. I decide to create an Registry key for the name of the last saves DWG and fill this key when SAVE, SAVEAS command ended. 2. My problem is how to open this drawing in VC++. I use readDWGFile, but I can't visualise it into AutoCAD.
Thanks in advance.
Daniela Gotseva
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Daniela,

 

1. Use the registry (preferable a key inside your
application registry entry);

2. Use the
acDocManager->appContextOpenDocument() function passing in the full file
name;

 

According to ARX documentation you must be in
Application Context to use this.

 

Regards,

Fernando.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi!

I want to open last saved DWG. Has anybody idea how to do this in
ObjectARX?
My decision: 1. I decide to create an Registry key for the name
of the last saves DWG and fill this key when SAVE, SAVEAS command ended. 2. My
problem is how to open this drawing in VC++. I use readDWGFile, but I can't
visualise it into AutoCAD.
Thanks in advance.
Daniela
Gotseva
Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks, Fernando.
Here is the decision:
void openInAppContex(void *pData)
{
if (acDocManager->isApplicationContext())
acDocManager->appContextOpenDocument(
(const char *)pData);
}
void openCompletely(const CString& strFileName)
{
AcApDocument* pDoc = acDocManager->curDocument();
if (!strFileName.IsEmpty() && pDoc)
acDocManager->executeInApplicationContext(
openInAppContex, (void *)(LPCTSTR)strFileName);
}

Daniela.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost