Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: dmacleod101 on July 15, 2021, 11:25:03 PM

Title: Shape array in shapesheet
Post by: dmacleod101 on July 15, 2021, 11:25:03 PM
Hi All,
I am working on a smart shape for a section of a guyed tower. The idea is to add some data into the group shape that allows the height, width, diameter of legs, etc to be defined and all elements within the group update accordingly. I have managed to setup the outline of the structure (Legs and Horizontal bracing top and bottom) along with the first of the diagonal bracing. As several of the elements are replicated throughout the shape X times depending on the section height, I would like to be able to create an array or duplicate these shapes X times. I have used the array shapes feature before but not sure how to achieve this from the shapesheet data.
Any ideas on the best way to achieve this?

Title: Re: Shape array in shapesheet
Post by: Surrogate on July 15, 2021, 11:44:29 PM
IMHO It is impossible via shapesheet! May be fillpattern for diagonal bracing ?
Title: Re: Shape array in shapesheet
Post by: Yacine on July 16, 2021, 11:48:10 AM
The trick is to not generate new shapes dynamically when needed, but to hide them when they are not.

Basically you would position the subshapes based on an index stored in a field - eg "prop.n".
The parent shape would have a field (in the attached file "user.maxN") that can be used to check if the index of the subshape is in the range and subsequently show or hide the sub-shape.
In my case maxN is directly proportional to the height of the group.
Each of the sub-shapes will have a command to increment the index by one when the shape is duplicate (cell "EventDrop"), so you don't need to write it manually, just duplicate the shape as many times as reasonable.

Hiding the subshapes can either be done via the geometry section (cell "noline") for simple shapes. For complexe shapes (like in my example), you can either superpose them with the first item or chose anoter appropriate methode (cf "the hidden world of shapes" in this forum).

HTH, Y.
Title: Re: Shape array in shapesheet
Post by: wapperdude on July 16, 2021, 06:43:51 PM
An alternative that would be shapesheet contained...
Pre-build the max structure, using multiple Geometry Sections.  Then, as suggested, use Shape Data to get the total number of sections up to max limit.

For example, let's say the tallest structure uses 10 sections.  In the shapeshjeet, would add Geometry sections such hat total number is 10.  The visibility of each section would be controlled by the User specified entry, say 5.  Thus, Geometry sections 1- 5 would be visibile, and 6-10 would be hidden.

Each Geometry section would be defined such that if would stack upon the immediately preceding section.  Thus, there is only one shape.  Limitation is that the shape properties apply universally to all Geometry sections.

Title: Re: Shape array in shapesheet
Post by: Yacine on July 16, 2021, 06:56:13 PM
Quote from: wapperdude on July 16, 2021, 06:43:51 PM
An alternative that would be shapesheet contained...

That's not an alternative but a better explanation in plain english of what I was trying to say. :D .
Title: Re: Shape array in shapesheet
Post by: wapperdude on July 16, 2021, 07:30:07 PM
@Yacine:  Hmmm.  Maybe I looked at wrong attachment.  The one I saw appeared to be a grouped shape.  I was trying to avoid duplicating you.  Oh well.