Jump to content
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Sign in to follow this  

×
×
  • Create New...

Important Information

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