LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview scripting: get equivalent references from group of copied items

I am trying to create a plugin that copies a selection from one case of a case structure to another specified case. I have it essentially working (albeit very ugly and probably not even a good way to do it; Its my first attempt at a plugin).

the current hang up I am having is if the selection being copied happens to be wired to a tunnel to the case structure.

 

(Quick aside, unless I am completely mistaken these tunnels seem to have the wrong ClassName associated with them: the case selector tunnel has a ClassName of Tunnel while the other tunnels have a CaseName of SelectorTunnel which seems swapped)

 

Back to the real question, if the selected items include the wire connected to the tunnels I would like to connect the copied wires in the same way. I am not sure how to go about doing this. My first thought was to somehow connect the wire directly to the terminal however I have not found any methods that allow connecting an existing wire to a terminal only methods that connect terminals together. so next I thought what if trace back the terminals the wire is connected to and then use then connect that to the tunnel's terminal. Also what do I do if the wire is not connected to anything else?

 

The real challenge I am having (and question I hope to have answered) is even if I find the reference to the terminal of the another end of the original wire, I don't know how to equate this to the new terminal on the new wire. Or even how to find which is the copied wire of the original connected to the tunnel (bearing in mind that there may be multiple wires in the selection with the same names). 

When using the Paste method it appears that the new items are automatically selected. I wrongfully assumed that new SelectionList would be in the same order as the copy was made from but this is not true. so no luck just grabbing the same index in the array.

Is there a way of getting the mapping of the original items references to the new references?

 

To further complicate things, all of the references I have are generic GObject type.

 

Anyway any help/pointers/suggestions would be greatly appreciated. 

Thanks

0 Kudos
Message 1 of 1
(1,642 Views)