LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control refnum for a typedef

Solved!
Go to solution

I have a typedef on a VI front panel and I would like to programmatically resave it to a new path/name.

with a VI I would open a reference to the VI and use the method "Save.Instrument" save a copy: true, and input a path.

 

What I have tried was to open a reference to the VI that uses the typedef, got a property node reference to it's panel,  then a property of array of control references - but generally controls can't be 'saved-as' but a typedef could - only there is no method for this.

Is there a way to do this? 

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 1 of 3
(2,939 Views)
Solution
Accepted by topic author lmd2

The control class has a property called TypedefVI which returns a reference to the VI of the typedef which you can then save. The only catch is that this method seems to be a scripting method, so you will need to install scripting first.

 

Another alternative, if you don't want to use scripting stuff, is to use the Callees property on the VI. This will return the names of all the typedefs it uses (which you can then use with the Open VI Reference primitive), but you should note that this doesn't give you a way of associating a specific control with a specific typedef.


___________________
Try to take over the world!
Message 2 of 3
(2,912 Views)

okay, I've installed the LV2009 scripting API, I have the control class /typedef method returning the ref - haven't finished coding/testing but I should be good to go

thanks a lot

 

lmd2 

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 3 of 3
(2,896 Views)