Jump to content
News about the LabVIEW Wiki! Read more... ×
Sign in to follow this  
paul_cardinale

XNodes: RemoveXNode method and ReplaceSelf ability

Recommended Posts

The context help for the "RemoveXnode" method says "Removes the XNode from the diagram.  The contents of the diagram of the XNode are merged with the diagram"

rx.thumb.png.1f276a0aa4c6f9765a76ff0465c99a6e.png 

However if you try it, it may or may not work.  That's because this method just calls the "ReplaceSelf" ability; so if an XNode doesn't have a "ReplaceSelf" ability, the "RemoveXnode" method will do nothing.

So if you want your XNode to work with the "RemoveXNode" method, you must create a "ReplaceSelf" ability.  Fortunately doing so is very trivial:  Your ReplaceSelf ability only has to call the "GenerateCode" Ability; like this:

rs.thumb.png.0e6406f02011dc122c1587e52e106716.png

Paul Cardinale

P.S. Note that the "ReplaceSelf" ability of some NI Xnodes doesn't work properly.  For instance if you call "RemoveXNode" on the "Match Regular Expression" function, it will make a mess, breaking the VI.

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.