So, I wrote several vis in a parent class... then found myself thinking "hmm, these really belong in the child class. I should move them".
Sure, I can create a new vi in the child class, copy/paste over, etc... but I was wondering if anyone had tricks / tools to make doing things like this easier. I find myself doing it more often than I should.
If you have both classes in one project, you can just drag the VI from one class to another. Then you can do a "Replace" on the class terminals to switch them to the new class, and do a "Save As" on the VI with the "Rename" option to move it on disk to the directory of the new class. Finally, go to the icon editor and delete the icon for the old class, then copy the icon from the new class from a different VI and paste it in.
Hm... I didn't think that worked. I was under the impression that the child class would claim the vi to be part of it, but the vi would still claim to be part of the parent class... though I guess I never actually tested it. That's what I get for assuming.
Finally, go to the icon editor and delete the icon for the old class, then copy the icon from the new class from a different VI and paste it in.
Actually you can go to the icon editor, Edit -> Import Icon from Owning Library and it will replace the class banner, leaving the other layers alone.
Well, I did this a couple of times today and it didn't seem like much less effort than just creating a new vi. Yes it does work, but it doesn't do anything for moving the vi on disk, changing input/output class to child class, etc. It would be nice to have all of that done by a tool.
It might be a fun little scripting project to do one of these days when I'm sick of doing actual work.
The problem is that LV can tell if\where to move the file. There are flavors of file organization. So, it simply doesn't do the move... A rename works.
I wouldn't be surprised if any of those fancy OO plugins (G#?, OpenGDS?) have options for this. you might want to check them out before reinventing spending time on scripting, even though it's fun.