Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: dvigil on June 24, 2014, 03:51:38 AM

Title: SmartShape with Custom Line Pattern
Post by: dvigil on June 24, 2014, 03:51:38 AM
I am trying to make a master shape in a stencil with a custom line pattern. I only want the custom pattern to appear if the user selects a specific option in the shape data. I have already created the custom pattern and added it to the stencil. In the master's shapesheet I wrote an IF statement for the line pattern so that certain shape data will change the line pattern.

The shape works perfectly fine when editing the master. When an instance is added to a new document, however, the custom pattern will not display. By opening the document explorer, it is apparent the custom line pattern is not being added to the document stencil/explorer.

Is there some way to force a line pattern from a stencil to a document stencil/explorer without having the user select it by hand? Otherwise is there someway to make my shape function as it should?
Title: Re: SmartShape with Custom Line Pattern
Post by: Yacine on June 24, 2014, 05:14:18 AM
It looks like the line pattern must be called explicitely at drop, otherwise the style is not copied to the drawing.
You may add an invisible shape with the line set to the right pattern to your master.
Title: Re: SmartShape with Custom Line Pattern
Post by: wapperdude on June 24, 2014, 03:30:42 PM
I suspect that you need to use a template in order to "capture" all of the customizations.  The stencil containing your shape, and the line patterns all get saved into single template document.  Then, when the shape is dropped, the reference ought to be there.  I haven't tried this specific case, but it ought to work.

Wapperdude
Title: Re: SmartShape with Custom Line Pattern
Post by: Yacine on June 24, 2014, 09:03:36 PM
Wayne,
the template would help, but you don't absolutely need it. Dropping a shape with a custom line pattern will copy this pattern to the target drawing.
Title: Re: SmartShape with Custom Line Pattern
Post by: wapperdude on June 24, 2014, 09:58:22 PM
I read the problem differently.  The initial shape is stored without using a custom pattern.  It is dropped onto  a new page, thus, no existing custom pattern is copied over.  Hence the IF event fails.

If the shape already is using the custom pattern, then, yes, the template approach is not needed.  However, that doesn't seem to follow the issue logically.

Wapperdude
Title: Re: SmartShape with Custom Line Pattern
Post by: Yacine on June 25, 2014, 05:00:02 AM
I agree, that's why I proposed to add a hidden shape with the pattern already set, to the master.
Title: Re: SmartShape with Custom Line Pattern
Post by: dvigil on June 25, 2014, 02:54:28 PM
Thank you for the thoughts so far. The shape is a connector, so adding a hidden shape will destroy those properties I think.

I tried using the SETF function to achieve the same effect as an IF statement, but could not get this to work either. I set the line pattern to the custom pattern then tried to write SETF formulas to overwrite the line pattern cell depending on the shape data. These formulas always had errors, i think because they contained the USE() function.
Title: Re: SmartShape with Custom Line Pattern
Post by: Yacine on June 25, 2014, 06:03:58 PM
The enclosed stencil shows that it works with Connectors as well.
The trick is to "transform" the connector into a group instead of grouping it. (Shape/Grouping/Convert to group)
Title: Re: SmartShape with Custom Line Pattern
Post by: dvigil on June 26, 2014, 09:53:08 PM
Thank you, this worked for me.