09-22-2021 11:18 PM
Hello. I wanted to change the default icon for new VI, so I searched it. And found this thread:
https://forums.ni.com/t5/LabVIEW/Change-new-VI-Default-Icon/td-p/2126240
and this answer:
http://forums.ni.com/t5/LabVIEW/change-default-icon-for-new-VI/m-p/448115#M218003
However, I couldn't open the last URL with the message "401 You don't have permission to access the resource".
Does anyone know the content?
Solved! Go to Solution.
09-23-2021 12:55 AM
The online documentation for these has always been limited, but searching for lv_new_vi.vi can lead you to relevant places, like this: https://lavag.org/topic/11373-lv_new_vivi-conpane/
09-23-2021 01:14 AM
Thank you. I will read the page you gave me and try to see if I can do what I want to do.
09-24-2021 01:36 AM
What I think you are talking about (or want to learn about) are VI Templates. Open LabVIEW, go to Help, LabVIEW Help, search for Template, and choose VI Templates. A bunch of Templates can be accessed by clicking File, New ... (the second dropdown entry). What you might want is a Custom VI Template (which shows up at the bottom of the list, once you create it and "point" to it), which you can also find in the Help for VI Templates.
I use this all the time. My default VI Template has no Icon, but has Error In and Error Out pre-populated on the Front Panel. I have a series of Icons I use saved as Templates for the Icon Editor, so when I make a new VI, the first thing I do is create its Icon, then start filling in the Front Panel and Block Diagram.
Bob Schor
09-24-2021 04:30 AM
Do I need to click multiple times to open a new VI with a custom icon?
Is there any way to use Ctrl+N to open the new custom VI, or call it with a shortcut key from QuickDrop?
09-24-2021 06:47 AM
If you'd group your VIs in libraries (or classes), you'd get a custom icon for free. On top of all the other benefits.
09-24-2021 12:50 PM
@CreosoteFish wrote:
Do I need to click multiple times to open a new VI with a custom icon?
Is there any way to use Ctrl+N to open the new custom VI, or call it with a shortcut key from QuickDrop?
My "guess" is that, somewhere, NI has specified the VI Template that is invoked by Ctrl-N. I looked in LabVIEW.ini, but didn't see anything that leapt out at me. Might poke around a little more ...
Bob Schor
09-25-2021 11:05 PM
@CreosoteFish wrote:
Do I need to click multiple times to open a new VI with a custom icon?
Is there any way to use Ctrl+N to open the new custom VI, or call it with a shortcut key from QuickDrop?
You can put any code you want in lv_new_vi.vi or in shortcuts you call from QD. That code can be used to create a copy of a template, add it to a library, show a dialog for editing the icon, etc.
10-08-2021 03:06 AM
The way to edit lv_new_vi.vi was too difficult for me to do...
The most convenient way for me seems to be to create a default VI template in advance and call it from file menu.
https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/creating_vi_icon/
Also, I found the "Saving a Banner as a Template" method described on this page.
If your goal is to change only the icon, saving the one you want to use as an icon as a template beforehand and then using "Ctrl+A→Del" to delete the default icon and recall it from the template seems to be a good idea.
10-08-2021 12:15 PM
I don't know a "Short Cut" (like Ctrl-N) to get a Custom Template. But if you create a My New VI.vit (or some other name) and place it in a known place (either in your Project or someplace in your LabVIEW Data folder where it won't get deleted), you can use the method I've been using for almost a decade --
To start a new VI, go to File, New ... (the second entry, one without the keyboard Shortcut). The first time you do this, it will open the "Create New" window that shows all the Templates that LabVIEW "knows about". Open the "VI" folder and scroll down to the "User" sub-folder. Click "Browse", find your "My New VI.vit" (or whatever name you used -- mine happens to be "Basic VI"), and choose it. It should open your VI Template (creating a VI called "My New VI", which you should rename before saving it, of course) with whatever Default Icon you have chosen for this VI Template. Note that you can do other things with this Template -- mine happens to have Error In and Error Out on the Front Panel, a 4-2-2-4 Connector Pane with Error In on the lower left, and Error Out on the lower right, no VI Icon (since I want to remember to "create an Icon for each VI", so I do it first when I'm creating the VI), and a Block Diagram with Error In and Error Out already sitting there.
Once you have done this, the next time you choose File, New ..., you will get the last thing you selected (i.e. "Browse", but after you choose your Template VI, it will then be the Template).
Bob Schor