07-26-2016 01:01 PM
I like nice and clean diagram. Very often I need to change order of cluster (un)bundle by name terminals, preserving wire connections. This wonderfull idea has been offered 6 years ago and forgotten.
http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Rearrange-Unbundle-and-Bundle-By-Name/idi-p/1210059
Has nothing been done yet?
Quick drop plugin, Ctrl+B. Select (un)bundle node. Plugin shows listbox with node items. Drag them to reorder and apply.
First version, so it is not perfect.
07-26-2016 01:07 PM
An almost-foolproof way to automatically enforce whatever order of elements you want is to always create a TypeDef for your clusters. When you Bundle/Unbundle By Name a TypeDef'ed cluster, the order of the Elements are whatever you decided in the TypeDef. Of course, if you have TypeDef A with one order, and TypeDef B with another (but otherwise similarly-named-and-typed Elements), all bets are off unless you take the trouble to reconcile the disparate definitions.
Bob Schor
07-26-2016 02:10 PM
It is not about the order of elements in the cluster, it is about order of terminals in bundle-unbundle by name.
Sometimes the order of terminals can avoid a lot of wire crossing.
07-26-2016 02:19 PM
I don't know Bob, I think this can be used pretty well in conjunction with type def'd clusters. For esthetic and code cleanliness I think this could be a useful tool. Plenty of times I'll have a cluster being unbundled and a wire on the buttom goes up and a wire on top goes down. This is usually the result of some refactoring where code pieces were moved around, but the unbundle is left in the order it was in. I did a quick test with this and I could see using it. However I think you're going to want to reconsider the default shortcut, since B is used by a plugin shipped with LabVIEW already.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-19-2020 12:17 AM
I am using this code as part of a plugin I'm writing, and I found an important bug that you may wish to correct.
The script works well when any cluster element has only a single unbranched wire attached. However, if you have a branched wire that terminates on a tunnel, deleting the wire deletes those terminals, and they are not rewired by your script. Consider this diagram:
It's a trivial example, but common during development... I know I need those indexed boolean values, and I don't want those wires deleted.
You can fix this by replacing the Wire:Delete method with Wire:Disconnect Terminal. This preserves the wire and thus all its other terminals. If there are wire bits laying around afterward, there's a method to clean those up as well.
02-19-2020 07:11 AM
You should attach your VI script that shows what it is you are trying to do.
Why do you consider this a bug? To me it sounds like you want the Delete method wire to be different than what it is defined for.
My understanding is that a wire is everything that exists between its source and all its terminals. Within that wire are joints that define where the individual segments meet or bend.
This is only a bug if the function only does something that the designer did not intend it to do. It is not a bug if the user of the function thinks it should be doing something different than the designer intended.
02-21-2020 01:08 PM - edited 02-21-2020 01:15 PM
Hi RavensFan, this is not about what I want to do, it is about the purported function of the quick-drop script that is the topic of this thread.
From the original post:
"Very often I need to change order of cluster (un)bundle by name terminals, preserving wire connections."
I have described a case in which the plugin fails (aka a bug), because rather than disconnecting a wire (the method to use that fixes the bug), the script first deletes the wire, and thus does not preserve the wire connections.
Please review carefully.
02-22-2020 03:57 AM
MyCFAVisit wrote:
Hi RavensFan, this is not about what I want to do, it is about the purported function of the quick-drop script that is the topic of this thread.
From the original post:
"Very often I need to change order of cluster (un)bundle by name terminals, preserving wire connections."
I have described a case in which the plugin fails (aka a bug), because rather than disconnecting a wire (the method to use that fixes the bug), the script first deletes the wire, and thus does not preserve the wire connections.
Please review carefully.
I think this can be used pretty well in conjunction with type def'd clusters. For esthetic and code cleanliness I think this could be a useful tool. Plenty of times I'll have a cluster being unbundled and a wire on the buttom goes up and a wire on top goes down. This is usually the result of some refactoring where code pieces were moved around, but the unbundle is left in the order it was in.