Tobias Hauß Posted December 2, 2019 Share Posted December 2, 2019 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! Quote Link to comment
JBenghiat Posted December 6, 2019 Share Posted December 6, 2019 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. Quote Link to comment
Nicolas Goutte Posted December 6, 2019 Share Posted December 6, 2019 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. Quote Link to comment
Tobias Hauß Posted December 9, 2019 Author Share Posted December 9, 2019 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. Quote Link to comment
Recommended Posts
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.