Hello,
I have a Plugin (menuCommand) that creates a Form Dialog (non-Modal Form from a C# Module) and from this Dialog I want to call READONLY commands to the sdk (for example: get Object Information of selected Objects in the Drawing).
When I call the functions as MenuCommands directly I have no issues. But when I attempt to call the commands from my C# Dialog, (almost any SDK command for example: "gSDK->GetObjectTypeN((Handle)objectHandle)") Vectorworks crashes with the following Exception: System.AccessViolationException". An attempt was made to read or write in the protected memory. This is often an indication that other memory is corrupted".
However, I can use the following Functions in the same way without problems:
->GetActiveDocument
->ForEachObject
Is this a known limitation from the SDK that it should not be called from another Application? Or is this something I can fix? I have done a similar implementation for other CAD programs that required a form of EventHandler to trigger the SDK Functions. Would this be a viable approach? Or am I missing something trivial here?
Thanks in advance for the information.
Best regards,
Mauricio