peterp Posted May 2, 2018 Report Share Posted May 2, 2018 Hi, We're about to re-structure our VI source tree and therefore I'm looking for a way to automatically edit/change the VI icons as well. To do so, I want to open all VI's and change the icon text as well as add a new icon layer (on top) and then save this VI (perhaps also rename it, move it to another location ...) The only problem I have - I can (with help of Icon editor API) open the existing VI, get the icon data (separate entries for text, different layers, ...) and adjust them to new informations/texts/icon layers. But it is not possible to write back these changes to existing VI, I can only create a new VI with this data. Or I can overwrite any old icon settings by passing a new icon, loosing all different icon layers and separate texts. Is there any way to edit an existing VI Icon without loosing the existing icon texts/layers? I even tried to open the original icon editor via script and do the edits with "SendInput" remote control of it's user interface. But didn't find a way to open the icon editor on first hand :-( So any ideas highly appreciated! Peter Link to comment
smarlow Posted May 2, 2018 Report Share Posted May 2, 2018 If you put all the VI's into a library (.lvlib), you can edit the library icon and it will be applied to all the files in the library as a layer. Most people use this to create a common "top banner" for their VI set. The lvlib icon is overlaid as a layer on the individual VI's icons without disturbing changing or disturbing the other layers. I assume that what you are trying to do is add some icon feature to a set of VI's that identifies them as being part of a set. Link to comment
Darren Posted May 2, 2018 Report Share Posted May 2, 2018 All of the functionality provided by the Icon Editor UI is also available programmatically with the LabVIEW Icon API, available here: [LabVIEW 20xx]vi.lib/LabVIEW Icon API This API, along with many others, is described in my Hidden Gems in vi.lib presentation. Link to comment
ThomasGutzler Posted May 3, 2018 Report Share Posted May 3, 2018 OpenGDS does a good job with updating VI icons. It lets you design your class icon and then automatically updates all VIs in that class. Uses the file names to generate text in the lower part Link to comment
peterp Posted May 3, 2018 Author Report Share Posted May 3, 2018 (edited) Hi, thanx for all your suggestions, I will check them. BTW, I already knew of "LabVIEW Icon API" and used it to create new VI's with proper icons, but I was not able to edit existing ones, so that the existing layer structure is preserved. I only want to add a top-most layer, to keep the old ones still available as backup... But I will check again, also the OpenGDS. To clarify my approach, I've added a sample vi (LV2017). I want to open an existing VI, add a user layer and text, and save them a copy of the VI. Peter _Test_VI_Icon.vi Edited May 3, 2018 by peterp Added sample code Link to comment
JKSH Posted May 3, 2018 Report Share Posted May 3, 2018 28 minutes ago, peterp said: I already knew of "LabVIEW Icon API" and used it to create new VI's with proper icons, but I was not able to edit existing ones, so that the existing layer structure is preserved. I only want to add a top-most layer, to keep the old ones still available as backup... Link to comment
peterp Posted May 3, 2018 Author Report Share Posted May 3, 2018 Hi JKSH et all thanks for the code snippet, now I got it (and find my error in my code) - I forgot to really save the changes I already made :-( Shame on me! Peter Link to comment
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now