Jump to content

Drop VI Template XNode


hooovahh

Recommended Posts

So this is an edge case for sure.  But there are times that I want to put reuse code on the palette, and drop a VIT on the selected VI.  VITs aren't very common but they will (normally) force the user to save the dropped VI as a new VI.  It is like opening a template from your File >> New... menu.  It doesn't drop the actual template, but instead makes a new unsaved VI, that has the code of the template in it.  

But if you drop a VIT from your palette you don't get a new copy, you get the template itself.  This came up in conversation at Becky's presentation on the Project Templates at NI Week this year.  I suggested that an XNode could make this possible and so here it is.  (sorry Becky for taking so long I forgot about it)

Anyway if you drop this XNode from the file explorer or palette, it will drop a new copy of a template, then delete the XNode that was dropped.  If you want to use your own template, edit the Get Help VI description, icon, and Window Title (this is what is shown on the context help and palette).  Update the code in the Template.vit, edit the VI description, and icon of this file to be the same as the Get Help VI (this is what it looks like when dropped).

The only issue I've found is that if you drop the template from your palette you need to use undo twice to get rid of it.  Once to get rid of the template (but this brings the empty XNode back) and again to get rid of the XNode.

Drop VIT Xnode.zip

Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...

Important Information

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