I am at the end of my knowledge
How can I copy via scripting a queue ref control from a front panel to a typedef control
Use the Move method (on the reference to the queue ref) instead of copy/paste. The owner will be the reference to the panel of the control.
Note that under scripting, controls are essentially VIs without block diagrams. You create a new one with the New VI primitive.
The owner needs to be the panel of the control, not the control itself.
I have attached the full sample code. For some reason, I could not attach a snippet.
Move doesn't work across VIs.
Do this: Get the type descriptor for the control then use the VI method "Create Control From Type" (or something like that) to actually create the control on the control VI.
You can also use the VI's Create from Reference method and give it the reference to your original control. This RCF plugin has an example - https://decibel.ni.com/content/docs/DOC-5812
Thanks for the help
So here are some information what is my idea.
I am writing a tool to create a VI hierarchy.
For that I need the possibility to create a type def with different controls on it.
Write now it is working only for on element the second one i got this error
DFGray that works with the panel but then I got this error
[ The front panel contains extra controls that do not belong to the custom control. You must delete these extra controls.)
I like this scripting and I hope there will come also soon a API to Icon editor via scripting
Specify the cluster as the owner instead of the panel and the control will be moved into the cluster instead of onto the panel. This should take care of the error.