05-30-2022 11:05 AM - edited 05-30-2022 11:25 AM
@Pierre_F a écrit
@JÞB a écrit :
Block diagram objects cannot be locked to a specific location. They can be excluded from block diagram cleanup with a Right-Click option which will prevent them from moving relative to each other while cleanup runs. This essentially Groups those objects but only for cleanup.
After a little more practise, I understand what you mean.
I was right clicking on the functions blocks/commands/constants/indicators to find "exclude from cleanup" after realizing that this option was only present on diagram structures: For thoses ones, it works very well.
About isolated functions, commands and wires, I'm including them in a "random diagram" (here below disable) and right click "exclude". then I remove it. It's not optimal, but it's sufficient.
@Pierre_F a écrit :
@JÞB a écrit :
Lables and Captions may be locked to their owning object (again, with a Right-Click. ) The exception being wire segment lables, they sort of Float along the segment while stretching or changes that add or remove wire bends.
bad point! Strangely, when I move the label at the right (for example) then right click on a command label ->"lock", after clean up, the locking of the label is ignored and its position comes back to left up. 😞
after "locking label" + "cleanup"---->>>>
@Pierre_F a écrit :
@JÞB a écrit :
Comments may be Attached to any object or node with an attachment arrow, cleanup may move them relative to each other.
no, it don't. the attachement arrow doesn't preserve position between label and "arrowed" object.
after "cleanup" ------>>>>
is there an option to set?
05-31-2022 02:30 PM
@altenbach wrote:
As a rule of thumb:
If diagram cleanup improves the look of your code. It must have been really (really!!!) bad before!
(I never ever use cleanup on my own code. I use it exclusively on bad code found here in the forum. 😄 . My programs are well structured from the beginning as they should be.)
When I create code, it's often spaced out and somewhat messy, but after I get it working, I always clean it up (manually) (if only I could get my cow-orkers to do that).
05-31-2022 03:04 PM - edited 05-31-2022 03:06 PM
@altenbach wrote:
As a rule of thumb:
If diagram cleanup improves the look of your code. It must have been really (really!!!) bad before!
(I never ever use cleanup on my own code. I use it exclusively on bad code found here in the forum. 😄 . My programs are well structured from the beginning as they should be.)
Sometimes I use diagram cleanup tool for small subVIs I created from existing code because I am too lazy to realign everything by hand. (It still looks bad, but better than nothing.) Oddly enough, the more complicated the resulting block diagram is, the more likely I am to align everything by hand. But that's not too often because my subVIs tend to be very simple.
06-01-2022 01:18 PM
I have never looked at the tuning options, but the most damaging cleanup effect is that well aligned and delineated horizontal "trains" of code anchored by shift registers tend to completely mess up and go all over the place, zigzagging across. I am even bugged by the iteration terminal getting slammed into the lower left corner instead of where it is normally, i.e. a few pixels in.
06-01-2022 01:37 PM
@altenbach wrote:
I have never looked at the tuning options, but the most damaging cleanup effect is that well aligned and delineated horizontal "trains" of code anchored by shift registers tend to completely mess up and go all over the place, zigzagging across. I am even bugged by the iteration terminal getting slammed into the lower left corner instead of where it is normally, i.e. a few pixels in.
Occasionally I feel like writing my own BD cleaner. But I just sit down and close my eyes until the feeling goes away.
-----
What bugs me is that when I select "Remove and Rewire", it rearranges (messes up) wire segments that it has no business touching.
06-01-2022 01:45 PM
@Pierre_F wrote:
bad point! Strangely, when I move the label at the right (for example) then right click on a command label ->"lock", after clean up, the locking of the label is ignored and its position comes back to left up. 😞
The locking of a label/caption does not prevent it from being moved to its default position programmatically, via diagram cleanup or via the CTRL+T Quick Drop Keyboard Shortcut. It sounds like you'll want to change those default positions within Tools > Options.
@Pierre_F wrote:
@Pierre_F a écrit :
@JÞB a écrit :
Comments may be Attached to any object or node with an attachment arrow, cleanup may move them relative to each other.
no, it don't. the attachement arrow doesn't preserve position between label and "arrowed" object.
after "cleanup" ------>>>>
is there an option to set?
You may have misread. They said "cleanup may move them relative to each other", which it did. There is a Description property for each control-class object that you could possibly use to document your code in a more inline fashion.
The more often you end up using Diagram Cleanup as part of your workflow, the more often things like this are going to bite you over and over.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
06-01-2022 02:14 PM
Here's is a comparison what the cleanup button would do to one of my simpler subVIs that solves some ill-posed linear algebra problem. (zoomed to 25% to keep some code privacy :D)
Just look at it!!!! FOR loop with tons of whitespace in upper left! 100x more wire bends! hard to follow the flow! Now much wider than than my 2560x1440 screen! terminals all over the place!
Undo!!! Undo!!!!