LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Neil.Pate

Replace directly from project

Status: New

How about a new menu item for the right click context menu? Replace --> "Replace with selected project item"

 

This would replace the currently selected VI in the BD with the VI that is highlighted in the Project.

 

I am sure this can probably be done with scripting and the Right-Click-Framework from JKI, but it would be nice to have this as a native feature.

 

Pic sort-of shows what I mean (the "From Project" would probably need to be more sensible but thats the idea)

 

replace.png

3 Comments
AristosQueue (NI)
NI Employee (retired)

A good idea. In the meantime, let me tell you about a workaround.

 

The feature you ask for already exists but is currently only available when you have a conflict in your project, i.e, you include two VIs of the same (fully-qualified) name but different paths in your project (either directly or in Dependencies). In this case, if one of them is in Dependencies, you can pop up on that one and select "replace with other", and all references in the project will be replaced with the other.

 

Now, since a conflict occurs even if the reference is to a *missing* VI, that means you can use the following workaround:

 

1) Rename the VI you want to replace to be something else.

2) Rename the new VI to be the same name as the one you want to replace.

3) Add the new VI to the project, and when you get the "warning, you're about to create a conflict" dialog, choose to allow the conflict (your other option is to create a new project to open the conflicting VI inside). 

4) Pop up on the (now listed as missing) VI and choose "Replace with other."  All references to the old VI from anywhere in any file listed in your project will point to the new one. 

 

 

Neil.Pate
Active Participant

Thanks for the workaround Mr Q.

 

Trouble with renaming files on the fly is that is causes absolute havok with my source code control (SVN)!

 

I suppose I am really being lazy with this one, trying to save a few seconds because I can normally navigate to the correct VI in the replacedialogue...

Pie56694
Active Participant

I've been going into the Project Explorer, right-clicking the VI I need from whatever code-reuse library it's in, selecting Explore.  Then I copy the folder location.  Then I go into LabVIEW and right-click the VI and select Replace and paste the folder location.  Then I type the name of the VI and select it from the file browser.  Yea...so I gave your Idea a Kudos.