Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: normschaef on January 06, 2012, 10:31:33 PM

Title: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: normschaef on January 06, 2012, 10:31:33 PM
Hi all:

I wanted to create a dialog based on visguy's blog on selecting colors using a dropdown menu. The problem is that it doesn't seem to work with a group. I can select a subshape, enter an RGB value in the fill foreground cell and the subshape changes as expected. I can select the group, right-click and format > fill and the color changes and adds THEMEGUARD(RGB(rrr,ggg,bbb)) to the fill foreground cell. However, when I try to put an RGB value in the group fill foreground cell nothing happens.

What am I doing wrong.

Using Visio 2007

Thanks,
Norm
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: wapperdude on January 07, 2012, 01:12:44 AM
Nothing.  Toplevel of group doesn't take fills.  It's just a way to, uh, group shapes.  If you want the background to be filled, you'll need to draw one more shape to look like the grouped shape, and add fill to that.  This new shape needs to be included with rest of the group.

HTH
Wapperdude
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: gwideman on January 07, 2012, 11:55:12 AM
normschaef: 

To elaborate a bit more, seemingly contrary to wapperdude's brief description, a top level shape possesses all the same apparatus as a normal shape, including being able to exhibit fill.  As you already discovered, it certainly has a fill format section in the shapesheet.

However, if you create a group shape in the process of selecting a bunch of shapes and then using the group function, that "wraps" the existing shapes as children in a top-level group shape that has no geometry section. Since fill needs to fill some geometry, when the group doesn't have its own geometry, it has nowhere to show the fill.  This is the case that wapperdude describes.

Sooo... if you want your group shape to show fill, then you have to add a geometry section to its ShapeSheet, and fill in some rows to create an outline.

Alternatively, you can start by selecting a shape that would be a suitable group, use the Convert To Group function to make it capable of managing child shapes, and then use the Add to Group function to add suitable children.  This way your top level shape starts with all the geometry, fill and so on that you'd like.

You can also choose whether the child shapes are drawn in front of or behind the group shape. If you're filling the group shape, you probably want the children in front.

As a final note, there are various options (whose settings correspond to various shapesheet Lock cells) that control what happens when you use the UI to change formatting when you have the group shape selected -- whether these should transmit to the children or not.  In addition, you can prevent UI format changes from affecting certain shapes using the ShapeSheet GUARD( ) function in the cells to be format protected.  So, for example, when you perform "Fill Green" on a group with three child shapes, you can have that affect the group (background?) and one child shape, but not the other two child shapes. 

-- Graham
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: vojo on January 07, 2012, 08:37:33 PM
fill at group level fills all the children to the same color

another way you could do this is
   - get your shapes
   - set their colors
   - in each that does NOT need to change , set fillforegnd = guard(<your desired color>)
   - group the shapes
   - when you fill at the group level...only the children without guard change
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: wapperdude on January 07, 2012, 10:15:53 PM
Strictly speaking, Graham is correct.  But, I'll stick by my explanation for a pragmatic reason -- unless I've missed something.  It's true that the group level doesn't normally, have a geometry section, hence, nothing to fill per se, (and, as Vojo notes, filling the group actually fills the subgroup shapes), adding a geometry section is counter-productive.  The group geometry shape will be at the highest Z-level, and so, if it is made fill-able, and non-transparent, it will completely cover and hide all of the subshapes.  So, practically speaking, what's the point of doing that?

However, I do apologize for being less than thorough in my answer, and perhaps somewhat misleading.  Hope I didn't cause too much confusion.

Wapperdude
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: vojo on January 08, 2012, 12:45:01 AM
Norm....if you want to see where all this ends ultimately....look below

right click....double click...etc to see all the ways to play with this cube

After that...copy it and tear it apart to see how things are done
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: normschaef on January 09, 2012, 12:41:08 AM
Thanks all for the responses.

The project I'm working on is creating shapes of different theatrical lighting fixtures; so I have lots of child shapes grouped. It doesn't matter if the whole shape is filled with the same color, as I want the color to reflect (so to speak) the color of the gel the Lighting Director wants to use. So, based on wapperdude's comments, what I'm going to try is create a vector shape of the outline of the fixture in Photoshop, import it into VSO as an SVG, make all child fill elements transparent and allow the user to change the color of the (for lack of a better term) mask.

Note, I tried creating an outline of the fixture using the Visio drawing tools, but got some odd results in using the Boolean functions to join my arcs and lines.

We'll see how my next idea goes.

Thanks again.
Norm
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: wapperdude on January 09, 2012, 02:32:48 AM
Ah!  Interesting.  Here's an idea, easier to show than to explain...

The idea is to select the desired shape to color, than transfer the "group" color only to that shape.  The technique is as follows:

For the group level you need to create entries into the right click context menu.  This is done by adding entries to the Action Section of the subsheet.  See enclosed example.  There needs to be a row for each spot that is to be colored.  I added an extra one so that they could all be "cleared".

Next, add the User-defined Cells, and create an entry that is placeholder for the selected spot.

Now, the following must be done to each subshape to be colored.
Open the shapesheet of the desired subshape and create a User Defined Cell section.  (See example).
In that section create two entries:  one to determine if that shape is the target shape.  Note, it is not actually selected at any time in the process of coloring.  The 2nd entry is the color transferred from the group.

Then scroll down to the Fill Section, and in the Fillforegnd cell enter the formula guard(user.color), where user.color is the name of the 2nd row created above.

The guard will prevent the shape from being colored unless it had been targetted.

There are other ways to do this, but, thought I'd give you something to "run with".

HTH
Wapperdude
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: vojo on January 09, 2012, 02:51:59 AM
well....if you want to try that approach....this might also help

right click

Frankly, once you work thru the logic of this shape, you wont need anybody's help ever again  ;-)
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: gwideman on January 11, 2012, 10:37:27 AM
Quote from: wapperdude on January 07, 2012, 10:15:53 PM
Strictly speaking, Graham is correct.  But, I'll stick by my explanation for a pragmatic reason -- unless I've missed something.  It's true that the group level doesn't normally, have a geometry section, hence, nothing to fill per se, (and, as Vojo notes, filling the group actually fills the subgroup shapes), adding a geometry section is counter-productive.  The group geometry shape will be at the highest Z-level, and so, if it is made fill-able, and non-transparent, it will completely cover and hide all of the subshapes.  So, practically speaking, what's the point of doing that?

However, I do apologize for being less than thorough in my answer, and perhaps somewhat misleading.  Hope I didn't cause too much confusion.

Wapperdude

Wapperdude -- you have the option to set the group to display behind the children. So if the group has geometry, then its fill can, for example, become background for the overall grouped shape.

In Visio 2010, select a group shape, Developer tab, Behavior button, Behavior dialog > Group data: Behind member shapes.  This used to be on the right-click menu, why it's now a "developer" feature, I don't know.  Or ShapeSheet > Group properties > Display mode=1.

This is actually a highly useful structure which simplifies cases where your intent is to have one shape be in some sense a visual parent, or visual corral, or visual frame, for the other smaller shapes.  If instead you have a no-geometry group in which one of the child shapes plays the role of visual background/parent, then you have to deal with a separate alignment box (and frame of reference)  of the group shape versus the visual frame of reference provided by the visual background/parent child shape. This added complexity is burdensome to keep track of, and adds opportunities for unintended editing.

Also, as I noted, the group level only commonly lacks geometry when you create a group by selecting (in the UI) a bunch of shapes and then applying the Group function.  But it's equally feasible in the UI to start by converting an existing shape into a group, and then add other shapes into it, or dropping other shapes into it.  And from Automation it's quite straightforward to create the parent shape, make it a group, add geometry, add children.

Vojo: The behavior where Visio fills child shapes when you fill the group level (and same for other formatting) is a UI behavior only.  There's no intrinsic link between the fill color cells on children and the corresponding cells on the group. And this UI behavior can be blocked for child shapes (LockFromGroupFormat cell).

-- Graham
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: vojo on January 11, 2012, 02:33:28 PM
Gwideman....correct....all i was pointing out is if fills at the group level using UI...children filled
I did not mean to imply there is some sort of subspace domain (cell relationship) tying them together intrinsically.
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: wapperdude on January 11, 2012, 04:15:52 PM
Thanks Graham.  :)   Didn't realize that was there.   ::)

I've just been upgraded to V2010 at work, will check that out. 

Do you know if that functionality is available in earlier versions?  I wrote my response using V2007, and had never discovered it -- it would be good to know -- I'll have to wait until the evening when I return home.

Understand about the color thing.  My example was to show how to use the UI to selectively color just one shape and not the others in a simple, straight-forward way.  My impression was the original poster had many shapes that overlayed, and selecting the desired shape tends to be difficult (not impossible) when they are nested in the z-direction. 

Wapperdude
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: gwideman on January 11, 2012, 10:50:39 PM
Quote from: wapperdude on January 11, 2012, 04:15:52 PM
Thanks Graham.  :)   Didn't realize that was there.   ::)

I've just been upgraded to V2010 at work, will check that out. 

Do you know if that functionality is available in earlier versions?  I wrote my response using V2007, and had never discovered it -- it would be good to know -- I'll have to wait until the evening when I return home.

Wapperdude

The functionality discussed in this thread has all been there since Visio 2000 anyway, and I'm pretty sure since Visio 4, the first version I used, and maybe earlier.  But exactly where in the UI has shifted around.
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: wapperdude on January 12, 2012, 01:42:32 AM
Well look at that!   ::)

So, for V2007, it's right click context menu> format > behavior > scroll down menu for Group data.  Must've seen this countless times, never tried it --- perhaps I took the "data" too literally.   :o

Thanks for pointing that out. 

Wapperdude
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: gwideman on January 12, 2012, 10:11:13 AM
Quote from: wapperdude on January 12, 2012, 01:42:32 AM
Well look at that!   ::)

So, for V2007, it's right click context menu> format > behavior > scroll down menu for Group data.  Must've seen this countless times, never tried it --- perhaps I took the "data" too literally.   :o

Thanks for pointing that out. 

Wapperdude

Yeah, the way it's labeled is hardly the most obvious!  As a matter of interest, the grouping feature has been the topic of debate for years -- is it a maneuver that regular users would be using as just part of clumping sets of shapes together on their drawing for convenient everyday wrangling, or is it "really" intended for building composite shapes that have some coherent semantic meaning and will be reused.  (The fact that grouping creates its own coordinate space within the top level shape contributes somewhat to the latter.)

I think this equivocality has precipitated some lack of consistency in the way the group feature set has appeared in the UI... it used to be as accessible as, say, flip and rotate. Now some of its capability has been shuffled in to the Developer ribbon, which isn't even available unless you explicitly use File > Options > Advanced > scroll... scroll... scroll... dammit where's that &^%$# option... ah, there it is at the bottom.

-- Graham
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: normschaef on January 16, 2012, 04:52:10 PM
I got my lighting shapes to work fine thanks to help from all of you.
I did end up creating the shape of the fixture in Illustrator then importing it into Visio. That then becomes the color filled shape. When the user drops the fixture onto the sheet, the shape data dialog appears with a dropdown of the Roscolux gel color names and numbers. When selected, the light is filled with the RGB color info from a lookup table (my variation of Visguy's post about selecting colors)

Thanks again.
Norm
Title: Re: Changing FillForegnd using the ShapeSheet for Grouped Shapes
Post by: Nemesis2103 on December 17, 2013, 10:16:16 AM
The soulution to your problem:
1) Create lines whatever you want and connect them together
2) Select all created lines --> Shape --> Grouping --> Group
3) Select new created group shape --> Operations --> Fragment
4) Select new created group shape --> Format --> Fill --> Do whatever you want  ;)