From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Drag VI path from listbox to block diagram

Anyone know how to drag a VI path from a listbox on a VI panel to the block diagram on a VI and have it copy the VI at the path and place it on the block diagram.

 

For instance I can drag a VI from Windows Explorer to a block diagram and it drops it on there.  I want to create an executable with a listbox on it for our developers.  Then they can just drag them to the block diagram of their code and plop the VI in there.  My thought was that if I can copy the VI to the clipboard it will work.  I've got this to work with Text but not the VI.

 

Thanks,

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 1 of 5
(2,355 Views)

In the Listbox: Drag Starting? event, use the drag data to determine the path of the subVI you want.  Feed that path into the UI.PlaceObjectOnCursor Application method.  Wire a True constant to discard the Drag.

 

Tweak the Drag properties of the listbox to get the behavior you want.

Message 2 of 5
(2,341 Views)

Thanks for the response Darin.  Unfortunately I don't want to use VI scripting because I need to create an executable out of the code. 

 

Anyhow, your method works great other than that.  Thanks,

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 5
(2,332 Views)

Why an executable?  By definition of your problem it seems you will be using the IDE.

0 Kudos
Message 4 of 5
(2,323 Views)

Because I think it's silly to run a VI as a tool.  Tools should be stand alone executables if possible.  Besides that if you run the tool from the IDE now you got a VI running while you are trying to develop.  Seems like a pain and who knows what application spaces are being shared or not shared.

 

Maybe I'm missing something but I prefer it be an exe.

 

Thanks again for the response,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 5
(2,316 Views)