LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I turn off Auto Grow for all structures in memory?

Solved!
Go to solution

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?

0 Kudos
Message 1 of 15
(3,313 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 15
(3,307 Views)

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?

 

0 Kudos
Message 3 of 15
(3,305 Views)
Solution
Accepted by topic author bmihura

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.

Message 4 of 15
(3,303 Views)

Capture.PNG

Lots of "Apparent" room for more check boxes and additional tabs (Show conditional terminal, P term, Auto grow.........)


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 15
(3,298 Views)

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!

0 Kudos
Message 6 of 15
(3,283 Views)

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.

Message 7 of 15
(3,277 Views)

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.

0 Kudos
Message 8 of 15
(3,266 Views)

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)

 

!0.png

 

While this proves auto grow isn't perfect (the case id overlaps the event border) at least the code isn't hidden


"Should be" isn't "Is" -Jay
Message 9 of 15
(3,258 Views)

0 Kudos
Message 10 of 15
(3,246 Views)