Document '.............................' has a command in progress

Document '.............................' has a command in progress

Anonymous
Not applicable
559 Views
3 Replies
Message 1 of 4

Document '.............................' has a command in progress

Anonymous
Not applicable
Hi,

If i start my own custom command (Acad 2008) that requires the user to pick points in multiple viewports, after the command has finished processing i seem to get multiple printouts to the output window saying Document '{DRAWING NAME}' has a command in progress, Hit Enter To Cancel or [Retry]:

This seems to only happen when switching between different viewports making them active whilst a command is in progress.

I am drawing my own graphics to the viewports using WorldDraw/Viewport Draw for that entity, if that means anything for this problem to occur...

Why is this happening and does anyone know how it can be resolved?

Many Thanks
0 Likes
560 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Oh another note is that i am using 'acedRegCmds->addCommand' to register my custom commands in conjunction with acedGetPoint(.......)

Thanks Edited by: fishtoasty on Mar 9, 2009 2:31 PM
0 Likes
Message 3 of 4

Anonymous
Not applicable
During my command i am accessing an object via its objectId as follows:



lockActiveDocument(); //own function that locks the active document

es = acdbOpenObject(blah, blahId, AcDb::kForWrite);

unlockActiveDocument(); //own function that unlocks the active document




It seems unlocking the document causes this issue whilst my command is in progress.
Is it safe to lock the active document without the subsequent unlock? As this seems to resolve my problem.
Will my command that is just defined as being ACRX_CMD_TRANSPARENT be unlocking the document itself once it completes its operation?
Is there anyway i can detect whether a command is currently in progress??

Many Thanks
0 Likes
Message 4 of 4

Anonymous
Not applicable
Quote taken from documentation seems to answer my question:

"Applications should normally never have to lock or unlock the current document. Commands registered with addCommand() or aceddefun() will have the current document locked before starting, and unlocked after ending"

Thanks
0 Likes