Jump to content
Sam Jones

Event Upon Deletion

Recommended Posts

Is there an event that is generated when a PIO is deleted?  Can this event be trapped and routines run before the completion of the deletion?

Share this post


Link to post

In other words,  no.  Oh well.  It would  have allowed for a lot of very desirable cleaning up for those PIOs that go around spreading information about themselves.  It doesn't seem like it would be a big stretch to implement since OnDeleteDelete is already implemented.

  • Like 1

Share this post


Link to post

Sam,

   This is not a definitive answer, and I've only played with it for a few minutes, but you may want to see if this gets you close enough so you can do your dastardly deeds.

 

   Do you need to make a distinction between your Plug-in being CUT vs. DELETED? If so, then stop reading HERE, as this won't help you. If not, then try adding a line at the end of your 44 event (kObjOnAddState) to test the state of "theButton" variable that's returned from the first line in the 44 event. It's going to take some sussing out on your part to see if it meets your needs. If you only get the 'Am I DeLETeD?' message when you expect it, then substitute the AlrtDialog() call with your cleanup procedure.

 

	vsoGetEventInfo(theEvent, theButton);

	case theEvent of
		...

		kObjOnAddState: begin		{ 44 }
			theButton := vsoStateAddCurrent(PIOHand, theButton);
			if (theButton = 14) then AlrtDialog(concat('Am I DeLETeD?'));	
		end;		{ 44 }

	end;		{ case }

 

HTH,

Raymond

 

  • Like 2

Share this post


Link to post

Raymond, 

 

Preliminary testing seems to show that this works wonderfully.  I still have some extensive testing of the cleanup routine to be sure I can do everything I need to do, but there doesn't seem to be any reason why I could not.

Thank you so much !!

 

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