SmartShape with Custom Line Pattern

Started by dvigil, June 24, 2014, 03:51:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dvigil

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?

Yacine

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.
Yacine

wapperdude

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
Visio 2019 Pro

Yacine

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.
Yacine

wapperdude

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
Visio 2019 Pro

Yacine

#5
I agree, that's why I proposed to add a hidden shape with the pattern already set, to the master.
Yacine

dvigil

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.

Yacine

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)
Yacine

dvigil