Christian,
It would seem that your code is operating in the Document Context.
Of course, we would need to actually see it to fully explore this.
If this is indeed the case, you can add a Session attribute to your procedure to make it act in the Application context.
Be aware that you may need to lock the document to modify it though.
The definition of 'Session' is such, according to the ARX docs:
ACRX_CMD_SESSION
The command will be run in the application execution context rather than the current document context, with the different capabilities and limitations that entails. It should be used sparingly.
This is an excerpt from the ObjectARX 2007 Docs -> AutoCAD Managed Class Reference -> ObjectARX Managed Wrapper Classes -> titled 'Defining AutoCAD Commands in Managed Applications':
[code]
This attribute declaration defines an AutoCAD command named COMINTEROP, and identifies the ComInteropCommand subroutine as the command handling method.
The CommandFlags.Session command flag indicates that this command should run in the session context.
Note that this method is declared Shared. In C#, an analogous declaration looks like this:
[CommandMethod(“COMINTEROP”, CommandFlags.Session)]
public static void ComInteropCommand() {
//...
}
As in ObjectARX, a command handler must be a public method with no return value and no parameters. [/code]
Good Luck,
C