04-11-2022 05:04 AM
Hello, I would like to know where can I modify the Block Diagram to ensure it prevents this from happening?
Is there a way?
Thank you for your time!
Solved! Go to Solution.
04-11-2022 05:37 AM
Right-click the structures and select "Auto-grow". This will prevent you from being able to make it smaller than its contents.
Also under Options, select on the category "Block Diagram" "Place structures with Auto Grow enabled" should be checked (set to true).
04-11-2022 08:34 AM
Thanks a lot!
04-11-2022 08:58 AM
Of course, this is just a Band-Aid for "don't make the block diagram so big". (IMO you should never need a main loop so big. Or any loop, really.)
04-11-2022 09:21 AM
Agreed, but in fairness, when stuff is hidden, you can't actually know how large the diagram is vs how large it looks.....
04-11-2022 11:38 AM
I would note that there is an alternate solution - VI analyzer. It doesn't check it in real-time like auto-grow, but it checks for anything hidden outside structure borders (as well as dozens of other problems).
I personally loathe auto-grow being on when using structures and I run a script to turn it off on all of my code if I ever get code from someone else that uses it (modified Nattify code). The problem is that auto-grow not only stretches the code for what it's in, but also anything "underneath" it in another frame of a case structure or event structure. So when I'm working on a case structure with 20 frames for a state machine or whatever, and auto-grow stretches out a case structure in one of those frames and I don't notice, and I save the VI, I now have 19 frames with their wires all with extra bends in them.
04-11-2022 02:50 PM
@Kyle97330 wrote:
I would note that there is an alternate solution - VI analyzer. It doesn't check it in real-time like auto-grow, but it checks for anything hidden outside structure borders (as well as dozens of other problems).
I personally loathe auto-grow being on when using structures and I run a script to turn it off on all of my code if I ever get code from someone else that uses it (modified Nattify code). The problem is that auto-grow not only stretches the code for what it's in, but also anything "underneath" it in another frame of a case structure or event structure. So when I'm working on a case structure with 20 frames for a state machine or whatever, and auto-grow stretches out a case structure in one of those frames and I don't notice, and I save the VI, I now have 19 frames with their wires all with extra bends in them.
I've gotten used to it.
I pre-emptively stretch my diagrams now.
Although I do wish there were two separate options, don't shrink to cover code and Auto-grow