10-09-2013 01:45 PM
I've inherited a ton of LabVIEW code with Auto Grow turned on for all the structures (For Loops, Case Structures, etc.). There are thousands of these structures.
How do I programatically (or otherwise) turn off Auto Grow for all structures in memory?
Solved! Go to Solution.
10-09-2013 02:10 PM
I question why you even need this. Or is it purely for personal preference?
You could likely dig into scripting to do this. I haven't dug into that yet, but it would be something fun to get into.
10-09-2013 02:16 PM
You should not do that. This may hide your code under structure, you (or the one who inherits you) will need to edit your code to see it. It is veeery strange and style-less.
I would rephrase this question:
Is there a way to turn on and apply Auto grow for all structures for all VIs loaded to memory?
I have inherited VIs with auto grow disabled.
Or am I wrong and the AutoGrow off state neither changes structure size not lets the elements go under it?
10-09-2013 02:17 PM
I've run into the same problem. I prefer not to use auto-grow, but naturally, it's on in most code I inherit. Anyway, this VI should solve the problem. I found it on these forums a while back.
10-09-2013 02:24 PM
Lots of "Apparent" room for more check boxes and additional tabs (Show conditional terminal, P term, Auto grow.........)
10-09-2013 03:35 PM
garrettmarsh, thanks, that VI does the job perfectly!
Others: I definitely want Auto Grow off because I then have exact control over the layout of my diagram. If I want to grow a structure, I can do it myself by control-dragging a rectangle within said structure.
So yes, this is certainly what I want!
10-09-2013 03:46 PM
You can still control the layout of your code with autogrow turned on. You just need to expand your structures before you had new code.
Having autogrow turned off is dangerous.
You add new code that would cause structures to expand. You have two choices.
1. With autogrow off, code expands beyond the bounds of the structure that you can't see. Sure your "layout" didn't change, but what good is it if you hide code?
2. With autogrow on, code expands and stretches the boundaries of the structure. You decide you don't like how it changed your layout. You can Undo what you did, manually adjust your layout (which is what you say you are doing now), then add your new code.
Number 1 is a huge problem. Number 2 is at worst an annoyance.
I use a tool like what is presented to fix autogrow by making sure it is turned ON for all structures in code I inherit. Autogrow turned off is just a bad, bad idea.
10-09-2013 04:27 PM
RavensFan,
You wrote "1. With autogrow off, code expands beyond the bounds of the structure that you can't see. Sure your "layout" didn't change, but what good is it if you hide code?"
I've never had code expand beyond the bounds of any structure that I can't see, at least not during my 23 years of LabVIEW coding. On rare occasion, I have shrunk the structure to hide the iteration terminal of a loop, but that's easy to fix.
Maybe we're doing something fundamentally different that allows your code to expand beyond the bounds of a structure that you can't see, whereas my code does not expand anywhere without me knowing about it.
10-09-2013 04:42 PM
A quick example of the danger:
The same code was copied and dropped into each case structure. One has auto grow Off. A Merge vi (Drop vi contents from palatte would do the same)
While this proves auto grow isn't perfect (the case id overlaps the event border) at least the code isn't hidden
10-09-2013 05:02 PM
Jeff·Þ·Bohrer, I now see how that could happen! I guess I've just developed habits to make such things NOT happen without even realizing it.