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

How to deactivate command in document contex?

5 REPLIES 5
Reply
Message 1 of 6
dgoceva
294 Views, 5 Replies

How to deactivate command in document contex?

Hi!
I want to use "New" AutoCAD functionality in ObjectARX. Well, I create a command:
void newDrawing()
{
static char pData[] = "acad.dwt";
AcApDocument* pDoc = acDocManager->curDocument();
if (pDoc)
acDocManager->executeInApplicationContext(
newInAppContex, (void *) pData);
}

void newInAppContex(void *pData)
{
if (acDocManager->isApplicationContext())
acDocManager->appContextNewDocument(
(const char *)pData);
}
....
acedRegCmds->addCommand("MY_GROUP", "cad_new", "cad_new", ACRX_CMD_MODAL, newDrawing);

newDrawing is my command, that I add into AutoCAD. Next I start AutoCAD and in contex of Drawing1 (by default) I write cad_new. New drawing with name Drawing2 creates as the result. Next I decide to close AutoCAD, but I receive a message that there is still active command on Drawing1. If I switch between drawing, no problem to close Application, but I want to do this by program. Does anybody knows how?
Thanks, Daniela.
5 REPLIES 5
Message 2 of 6
sherpa
in reply to: dgoceva

did you try
acedPostCommand("CANCELCMD");
?
Message 3 of 6
dgoceva
in reply to: dgoceva

I'm sorry, but I can't understand you. I try to find acedPostCommand, but there is no such function in ObjectARX help. My compilation finished with error: "error C2065: 'acedPostCommand' : undeclared identifier".
I need of more explanation, please.
Regard, Daniela.
Message 4 of 6
Anonymous
in reply to: dgoceva

See knowledge base artical 17088 at


for how to invoke this undocumented command.

 

Also take a look a Owen's Autocad Exposed page


for pre-2000 undocumented functions.

 

Paul Kohut


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I'm
sorry, but I can't understand you. I try to find acedPostCommand, but there is
no such function in ObjectARX help. My compilation finished with error: "error
C2065: 'acedPostCommand' : undeclared identifier".
I need of more
explanation, please.
Regard, Daniela.
Message 5 of 6
dgoceva
in reply to: dgoceva

Sorry, but the problems still ocuured. I declare acedPostCommand function and use it before createing a new document. I make many examples: in reactors, out of reactors, but nothing changes. If I close AutoCAD application, I receive a message: "AutoCAD can't close because there is command still active. Please, complete the command and try again.". How can I remove this message?
(Ofcource the message doesn't persist if I switch to the first document and after that use Alt+F4).
Thanks in advance, Dani.
Message 6 of 6
dgoceva
in reply to: dgoceva

I find the way. If somebody has the same problem, let see ADN number 44759.

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

Post to forums  

Autodesk Design & Make Report

”Boost