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.
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.
08-27-2013 03:11 PM
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,
08-27-2013 03:39 PM - edited 08-27-2013 03:39 PM
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.
08-27-2013 03:48 PM
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,
08-27-2013 03:59 PM
Why an executable? By definition of your problem it seems you will be using the IDE.
08-27-2013 04:20 PM
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,