LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a default icon and replace current one

I was sure there was a way of doing this.  More surprising is that nothing remotely similar came up in my search results.

 

Everytime I want to create or edit an icon, the default one is automatically created.  It is NEVER what I want.  I want a blank icon becuase I ALWAYS edit them.

 

Picture = 1000 words:

 

Current Default Icon:

 

 

 

What I want as a default icon:

 

 

 

 

So here is my question:  How can I do this?  How can I create my own version of a default icon that is not project specific or related to any project and that I can obtain every time I create a new VI?

 

 

 

Download All
0 Kudos
Message 1 of 14
(5,796 Views)

The attached VI will give you an idea about what is possible in manipulating icons.  Drop it into any vi that you have saved, and it will make the icon of that vi match the file name of the VI.

 

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 2 of 14
(5,783 Views)

You can write a callback VI to intercept the New VI action and script your own.

 

You can modify the Icon Editor to wipe out the layer 'VI Icon'.   I have a little check, if the only user layer is 'VI Icon' and it mostly matches the default icon (outside the number area), then I replace it with a blank.

 

What I suggest you do is make templates your friend and stop creating VIs from scratch.  You can add a better default icon amongst many other things.  A few templates tend to go a long way for me (usually with and without wired error terminals).  The New... dialog used to be quite slow and annoying, it has gotten better.

Message 3 of 14
(5,778 Views)

This has also bugged me in the past. I was actually thinking about posting a somewhat related new idea lately: adding a button to the icon editor that would clear everything.

 

I would even have it clear the frame, because most of the time my icons are not full size and I draw a smaller box according to my requrements. (Maybe: <first click> clears the contents, <second click> clears the frame. (If the icon is empty, the first click would clear the frame, of course)).

0 Kudos
Message 4 of 14
(5,737 Views)

I was thinking about posting an idea too.  But I looked for similar ideas, found none.. Figured this already existed, hence this post...

 

Idea posted here

 

Darin,

 

You are correct... Using templates is a good idea.  Nonetheless, I still think the LabVIEW environment should allow users to select their own default icons.

 

 

 

Spoiler
Give kudos HERE

 

 

 

0 Kudos
Message 5 of 14
(5,723 Views)

Just to clarify, what Darin was suggesting was actually a real option - you *can* run your own code when a new VI is created (like when you press Ctrl+N). The magic is in placing the correct callback VI in the right place and then using its output to tell LV not to create the new file on its own.

 

In searching for some relevant threads on this I saw this thread, which appears to do exactly what you want, although it appears to be for 7.1, so if you want to do something clever with the icon, you might need to modify some of the code to work with the new one, although I'm assuming you'll simply be fine with whatever icon is on the template. If you want more info on this, just search for "lv_new_vi.vi".


___________________
Try to take over the world!
Message 6 of 14
(5,704 Views)

Thanks tst,

 

You are correct.. it is what I was looking for.

 

Which supports my proposed idea.  If someone went through all the trouble to implement this workaround, it means that others are looking for a basic behavior that LabVIEW Development environment should support. Otherwise Felix may have to update his solution for future releases of LabVIEW that may break it...

0 Kudos
Message 7 of 14
(5,673 Views)

In the meantime, copy this vi to LabVIEW 201{2+}/resource/plugins/lv_new_vi.vi

 

Edit the icon if you do not like my new default (the icon of this VI becomes the new default)

 

LV12+ since I was not in the mood to post any naughty code and I wanted to preserve icon layers.

Message 8 of 14
(5,622 Views)

In the middle of my rant about having to zip a VI the forums went into a state of 'Processing Request...' so I was unable to edit the previous post.

 

Use this file instead, I always forget that the callback vi runs in a different context so I made a small change.

 

Unzip the @#$@# file and place it in the proper directory.

0 Kudos
Message 9 of 14
(5,586 Views)

The "Default Application" property always returns the main application instance...so when you have a project open (or a VI from a project open), Ctrl-N with your plugin VI creates the new VI in the main application instance...not the appropriate application instance from within the project. I tried playing with the code, including calling some private methods, and I couldn't get the plugin VI to properly return a reference to the "active" application instance, i.e. where the VI would normally get created when pressing Ctrl-N. If y'all figure out a way, let me know.

0 Kudos
Message 10 of 14
(5,546 Views)