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

Close AutoCAD drawing immediately after opening crashes AutoCAD

2 REPLIES 2
Reply
Message 1 of 3
cadsindia
636 Views, 2 Replies

Close AutoCAD drawing immediately after opening crashes AutoCAD


Hello,

 

We followed the procedure that you have mentioned in the ADN knowledge base article id TS58585 (How to close AutoCAD drawing immediately after opening).


It works fine in AutoCAD 2010, 2011.


But, it crashes AutoCAD in AutoCAD 2012, 2013.


Please find the attached arx project to reproduce this case.

 

Thanks.

2 REPLIES 2
Message 2 of 3

Hi,

 

Try below steps.

 

from On_kLoadDwgMsg use "executeInApplicationContext" and provide a callback function

 

acDocManager->executeInApplicationContext(closeDoc,curDoc());

 Then in the callback function start your command. Make sure your command is in session/application context.

void closeDoc(void *pDoc)
{
	AcApDocument *pADoc = (AcApDocument*)pDoc;

	acDocManager->sendStringToExecute(pADoc, L"_closeMe ");
}

 in the custom command, close the document.

static void adsMyGroupcloseMe () 
{
	acDocManager->closeDocument(curDoc());
}

 



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

Message 3 of 3

Hi,

This solution does not work, if NEXTFIBERWORLD is set to 0. ( AutoCAD 2013 )

Thanks

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

Post to forums  

Autodesk Design & Make Report

”Boost