Visio Discussions > ShapeSheet & Smart Shapes

Change fill based on user entered shape data

(1/4) > >>

I'd like to add another shape to my original shape that changes which fill is shown depending on which option the user selects when they place the shape in a drawing.  I drew a shape in my master, and in it's shape sheet, I am trying this:  IF(STRSAME(Sheet.5!Prop.PanelDirection="B","B Vault Panels","A Vault Panels"))  where Sheet 5 is the original shape in the master and "B Vault Panels" and "A Vault Panels" are fills that I created. 

If the above is not possible, I could create two similar shapes, one with each fill and just have them Show or not show depending on the user's choices.  I tried this by entering: =NOT(STRSAME(Class 2 Vault!Prop.PanelDirection="A",TRUE)) in the Geometry1.NoShow cell of the added shape, but it also does not work. 

I hope my question is not too basic, I have become the go to Visio person in my office, and feel over my head at times... :-[

Visio Guy:
Hi Michelle,

You're close, but you need to get SHAPETEXT(Sheet.5!TheText) to get the string of the text from the group, and you need to use a string-comparison function to test it. You can't do a direct "A"="B" in the ShapeSheet (both strings evaluate to zero, sort of).

Try this instead:

FillPattern =IF( STRSAME( SHAPETEXT(Sheet.5!TheText),"Vault Panels A"), USE("A"), USE("B") )

You might add GUARD( ) around the whole thing as well to prevent users from overwriting your fill pattern.

Hmm, That didn't work, either.  I must have something in the original shape wrong.  The idea is that the user will place the shape then make several choices in a shape data box that will help form the correct part number as well as direct the form and look of the shape.  I do have the part number portion of this equation working. When the user chooses either "A" or "B" from the pull down, the corresponding letter appears in the part number.  I'd like to add the fill to visually show the user thay have made the correct choice.  I am wondering now if I am doing something wrong in my adding a shape while working in the master shape...  Do I need to group the new shape with the original master shape? 

In trying to "understand" the text string you suggested, I tracked down the cell "TheText" to see if I could get the logic behind the string... but my TheText cell in Sheet.5 has no formula. 

Thanks again for your patience!

Visio Guy:
TheText is really kind of a token--a placeholder--so to speak. I don't know if it's really related to TheText cell that you're referring to in the Events section, I suppose so. But TheText itself has no meaning without using the string comparison functions.

I tried the formula I gave you in a shape I built, so it should work.

Try breaking it all up into pieces to see if your text comparisons are working. You can show values or formulas in the ShapeSheet, so you can look for TRUE or FALSE values. Once you know that your text comparisons are working, then you can worry about fill patterns.

First I feel I must apologize for my lack of experience!  :-[

I have been working on trying to figure this issue out.  I have been trying to use the formula you gave me, but I can't get it to work.  It does seem like my problem stems from the fact that the choice the user has to make is "A or B", and not "1 or 2".  I can't change that aspect though, as the part number created has to be an A or a B. 

When I couldn't get the fill change to work I tried to focus on just making blocks with the desired fills either show or not show depending on the user's choice.  I could only get it to work one time in desperation when I changed the user's choice to "1 or 2".  Then I changed the Geometry.NoShow Cell to read:"STRSAME(Sheet.5!Prop.PanelDirection="1",True,False)    This does not work if I change back to "A or B".  Argggh!  I also tried to modify the suggestion you gave me to work in the Geometry.NoShow Cell, using: IF( STRSAME( SHAPETEXT(Sheet.5!TheText),"A"), False, True )  with no success.  The closest I can get is a long line of formula text and the outcome is the shape is either always on or always hidden. 

Thanks again!

P.S. Is there any way to attach a shape to a post so you can see it? 


[0] Message Index

[#] Next page

Go to full version