Sam Jones Posted July 15, 2023 Share Posted July 15, 2023 In the procedure I call for the kObjOnAddState event has the following set of lines EventMessage := vsoStateAddCurrent(PIOHan, EventMessage); IF EventMessage = 14 THEN {Cable Instance is DELETED} BEGIN {Gets rid of stuff in other objects} END; However the EventMessage that is returned when I move a cable from one layer to another is also “14”. This results in the {Gets rid of stuff in other objects} code being executed. Clearly I don’t have a good understanding of what’s happening. Is there a way to distinguish between moving a cable from layer to layer and deleting the cable? Quote Link to comment
Hippocode Posted July 18, 2023 Share Posted July 18, 2023 I thought moving an object should return 1 (kMovedReset). Are you moving by property change or using Cut/Paste? Quote Link to comment
Sam Jones Posted July 18, 2023 Author Share Posted July 18, 2023 4 hours ago, Hippocode said: I thought moving an object should return 1 (kMovedReset). Are you moving by property change or using Cut/Paste? Changing the Layer in the OIP Quote Link to comment
Hippocode Posted July 20, 2023 Share Posted July 20, 2023 I looked into my notes and found this list of events that occur on specific triggers. Looking at these events, it seems that to move an object to another layer it's destroyed and recreated after, or at least those states are triggered. The internal index of the object stays the same though. With the SDK you can actually catch that exception when looking at the data provided in the event 14, but I'm unsure if this is available in Vectorscript. 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.