I have an interesting situation that I can't figure out how to do. I want to take a control from a running VI and replicate it on a new VI (with the same colors, properties, etc). However using the TopLevelDiagram:Make Selection and Copy selection methods, you can only copy from a VI in edit mode. Does anyone have other ideas on how to accomplish replicating a control using VI Scripting?
Thanks for the help,
Why can't you get a refnum to the control you want to copy, read it's properties, create a new control, and set the properties?
I can get you close, but not the exact control...
The forum won't let me post images at the moment... I'm not sure why... so I posted the image of the diagram here:
Just use the VI's Create by Reference method. I added a snippet in AQ's thread.
Hey thanks everyone for the advice.
Steve: This would definitely work, just requires more work when I was pretty certain there was a much simpler method.
AQ: This copies the data type of the control only, I was looking to copy all of the properties, class type, colors etc.
tst: This seems to do exactly what I was looking for!
Attached is the VI example in case anyone stumbles across this later on...