Jump to content
Developer Wiki and Function Reference Links ×

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


Tobias Hauß

Recommended Posts

Hi,

 

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!

Link to comment

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.

Link to comment

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.

Link to comment

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.

×
×
  • Create New...