Jump to content
Mauricio Rodriguez

Starting Vectorworks Process from Plugin (External Dialog) causes Crash

Recommended Posts

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

Edited by Mauricio Rodriguez

Share this post


Link to post

I’m not sure I entirely understand the question. I can say that any dialogs should be created using Vectorworks’ dialog classes. If you are using OS based dialogs, that can create issues. 

 

 

Share this post


Link to post

Hello Joshua, thanks for your reply. I just updated the description. Hopefully it is clearer now. 

I am in fact using a non-VW Dialog. But it should be possible to work with it I think.

 

Basically I am collecting several objects' Handles in a vector and then I want to query some attributes of the objects (Room Area for example) that I have stored in my vector. This is simply triggered by a WPF Form.

 

Share this post


Link to post

Hi Mauricio,

 

You can’t use WPF within the Vectorworks environment. The SDK has its own UI calls, presumably so the don’t interfere with the memory space if palettes and the drawing window. You can enable Dialog Builder, which lets you create dialogs with a GUI. 

 

You may be able to safely run python or VectorScript from your dialog, which may be enough to extract the data you need. 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...