Jump to content
Tobias Hauß

gSDK->DuplicateObject() does not send object events?

Recommended Posts



we listen to object events via the VectorWorks::Extension::IObjUpdateSupport interface. We accept state events for our objects with: IObjUpdateSupportContext->AcceptState(const TXString& objName). 


When creating objects with gSDK->CreateCustomObject(..), two events are send: 

* ObjectState::kObjectCreated

* ObjectState::kFirstRegenReset


Deleting objects with gSDK->DeleteObject(..) sends also events:

* ObjectState::kObjectDeleteBefore


But if we use gSDK->DuplicateObject(..) to duplicate objects, there are no events send. We would expect the following events (because a new object is created):

* ObjectState::kObjectCreated

* ObjectState::kFirstRegenReset


Is there a property we have to set to get those events? Or is there something else we are missing?


Thanks for any help!

Share this post

Link to post

This is consistent with duplicating object with Vectorscript. I think the presumption is that when you duplicate an object via script, you are in control of the action and can have objects respond accordingly.


At the very least, I don't think you should expect a kFirstRegenReset. The object already has it's contents (duplicated from the previous object), so no regeneration is necessary. You are going to get a kMovedReset if the object is set to reset on move.

Share this post

Link to post

Yes, but our problem is that it is not our script. So we are not in control what happens in the case of our PIO, which is very unpractical, as not all data should be simply duplicated.

Share this post

Link to post

Hi JBenghiat,


thanks for your reply. We do not want to activate "kMovedReset" because it may be expensive to recreate the geometry. We only need the "a new object was created" events, so that we can handle some intern stuff like generating new uuids / names for our intern object connection system. The problem is, like Nicolas said, the SDK calls are not on our end and we do not control it.


For example, if you drag + paste or duplicate objects in the Vectworks document (via user interaction), the events are send.


It would be nice to have an option to get control of the event system - maybe sth. like this: gSDK->DuplicateObject(bool doSendEvents = false).

For gSDK->DeleteObject there is a separate function call gSDK->DeleteObjectNoNotify to ignore events when objects are deleted.

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.

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...