04-19-2012 09:47 AM
I want to use LabVIEW scripting for deriving classes from a base class.
The simple way I do this is to open the base class, save it with a different name to a new folder and then removing all VIs and controls that are not dynamic dispatch VIs. And then adapt the inheritance of the new class.
I can not get the removal working. I can identify the VI/ctl and then invoke DisconnectFromLibrary on the VI/ctl. However, this does not REMOVE the VI/ctl from the class library.
How can I do this correctly?
Attachment demonstrates the problem:
05-09-2012 10:25 AM
Are you being certain to save the library after you call disconnect on the VI? Depending on how you obtained the reference to the library it might not be prompting for save as it exits memory.
I should have looked at the posted VI before responding. Give me a bit to look at it and I'll post again.
05-09-2012 01:01 PM
Looking into this further, I believe you are correct that DisconnectFromLibrary doesn't do anything to tell it's owning library that it's gone. This is not the right behavior, and I've filed CAR #353988 to fix it.
In the meantime you can work around this deficiency by using scripting to interact with the project tree for the library instead. Ask the library for a reference to the items it contains, iterate over those items to find the ones that represent VIs you want to remove, and call ProjectItem:Delete on the ones you don't want. That worked for me on my toy example here.