12-03-2021 05:02 AM - edited 12-03-2021 05:05 AM
I'm exploring a scripting tool to clone case structure cases from one case structure to another. It's part of a bigger vision, and for this requirement I've made good progress but right now I'm stuck on one final step - how to connect loose wires to case tunnels using scripting?
In the below example, the left hand "Source" VI has a case structure identical to that in the right hand "Dest" VI, except the source case structure has an additional case called "Receive_Number". I can create a new case in the Dest Case Structure, name it and then copy the contents of the Source case into the Dest case, resulting in the snapshot below. What I can't figure out is how to wire those existing loose wires to the tunnel terminals?
I can replace them easily enough and then LabVIEW chooses it's own routings, but I need them to be exactly the same so I wish to keep them and connect their ends to the tunnels. I can't find a way to use the method "Connect Wire" on those wires, only on nodes and terminals.
Has anyone worked with the scripting of existing wires?
Solved! Go to Solution.
12-03-2021 09:05 AM
What happens when you just wire the existing connected terminal of the wire to the tunnel?
(Is auto routing turned off?)
12-03-2021 10:41 AM
You can read the Joints[] property of the broken wire to get the coordinates of all the bends, then you can delete the broken wire, and re-create it with those same bend coordinates with the Create Described Wire method.
I don't know of any other way to do what you're asking.
12-03-2021 11:18 AM
12-03-2021 11:20 AM
12-03-2021 01:05 PM
@Thoric wrote:
Hi Paul,
My question is a scripting question, I can't 'just join the wires'. I'm looking to do this programmatically. Thanks for pitching in though 😀
Yes, I realized it was a scripting question. I'll reword my response:
What happens when you just script connecting the wire's existing connected terminal of the tunnel?
12-04-2021 05:06 PM
@paul_cardinale wrote:
@Thoric wrote:
Hi Paul,
My question is a scripting question, I can't 'just join the wires'. I'm looking to do this programmatically. Thanks for pitching in though 😀
Yes, I realized it was a scripting question. I'll reword my response:
What happens when you just script connecting the wire's existing connected terminal of the tunnel?
You get an error:
12-04-2021 05:14 PM
@Darren wrote:
You can read the Joints[] property of the broken wire to get the coordinates of all the bends, then you can delete the broken wire, and re-create it with those same bend coordinates with the Create Described Wire method.
I don't know of any other way to do what you're asking.
Thanks Darren, works perfectly.
12-06-2021 09:59 AM
@Thoric wrote:
@paul_cardinale wrote:
@Thoric wrote:
Hi Paul,
My question is a scripting question, I can't 'just join the wires'. I'm looking to do this programmatically. Thanks for pitching in though 😀
Yes, I realized it was a scripting question. I'll reword my response:
What happens when you just script connecting the wire's existing connected terminal of the tunnel?
You get an error:
OK, let me try again.
What happens when you just script connecting the wire's existing connected terminal of the appropriate terminal of the tunnel?