Visio Guy

Visio Discussions => Shapes & Templates => Topic started by: cookiejar on February 15, 2010, 10:45:06 PM

Title: Different line patterns in one shape?
Post by: cookiejar on February 15, 2010, 10:45:06 PM
Hi all, is it possible to use different line weights/colors in one shape? I know I could draw several lines and group them. However, I also want to create a few control points to control the positions of the lines. Thanks in advance for ideas.
Title: Re: Different line patterns in one shape?
Post by: wapperdude on February 16, 2010, 01:41:02 AM
No, well, at least not that I'm aware of.  The line patterns, colors are global to the shape.  About all you can do by use of multiple geometry sections in the shapesheet is to turn lines on / off.

But, once you group your lines, you can add control points at the group level, and pust their positions down to the sub-shapes within the group. 

Wapperdude
Title: Re: Different line patterns in one shape?
Post by: Jumpy on February 16, 2010, 06:41:38 AM
You could than add ShapeData Rows at the group level, too. And with the ShapeData you could control things like LineWight, -Pattern, -Color of individual lines inside the group without the need to subselect them everytime you want to change something.
Title: Re: Different line patterns in one shape?
Post by: vojo on February 16, 2010, 02:14:06 PM
to be clear, what I believe Jumpy is getting at is that you could have custom or user cells at the group level and each subshape (line) in the group can be tasked to use the right user cell.

Something like this in the group
user.horz = X
user.vert = Y
user.rtbend = Z
user.ltbend = A
etc

In subshape
   Determine the type
      (either by have a stencil of horz, vert, rtbend, ltbend and you lay out and group....then mary to group cells)
      (or using some inspection of the geometries or shape transform to figure out its a horz, vert, rtbend, ltbend)
   Have the check place the right stuff in the line or fill cells....something like Setf(getref(fillpattern), groupshape!user.horz)


Now if you have a lot to do....then might want to think about the following:
   Make a template
   on the page shapesheet... add  (using custom props allow you to tailor behavior by page without having to go into shapesheet  (eventdblclk = docmd(1312) will bring up props on a form)
       prop.horz
       prop.vert
       etc.
   when dropping a shape (from a stencil made to work in this template), shape picks up right personages
       for a vertical line shape....something like this in the event on drop cell   eventondrop = setf(getref(linefill), thepage!prop.vert)


This way...if you want to change the behavior of say vertical lines....update page cells (by double clicking page) and all vertical lines are updated.


Title: Re: Different line patterns in one shape?
Post by: cookiejar on February 16, 2010, 06:03:37 PM
Thanks for the replies. Somehow I can't seem to reference group level shape data from a subshape though. Here is what I want to achieve: I want to have a group level boolean value that controls the visibility of two lines in the group. In the two lines in question, I try to set Geometry1.NoShow to formula "Sheet.9!Prop.Front" where 9 is the ID for the group shape and "Front" is the property name. I'm sure the ID is correct because I have referenced its BeginX/BeginY in other fields. Any ideas? Thanks.
Title: Re: Different line patterns in one shape?
Post by: wapperdude on February 16, 2010, 08:08:41 PM
My apologies for asking the obvious, the prop.front is either "True" or "False", or "0" or "1"?  That's the only values "NoShow" understands.
Title: Re: Different line patterns in one shape?
Post by: cookiejar on February 16, 2010, 08:49:12 PM
Yes, I defined it as a boolean. I'm getting an dialog asking me to input a formula. I'm using Visio 2010 RC.
Title: Re: Different line patterns in one shape?
Post by: vojo on February 16, 2010, 09:09:52 PM
I do just what you are doing ALL the time in 2003...dont know about 2010 bugs...but should be able to do that.

See below.....double click group....watch behavior
Title: Re: Different line patterns in one shape?
Post by: Jumpy on February 16, 2010, 09:27:40 PM
Quote from: cookiejar on February 16, 2010, 08:49:12 PM
Yes, I defined it as a boolean. I'm getting an dialog asking me to input a formula. I'm using Visio 2010 RC.

What dialog asks you to input a formula? You should only get a combobox where you can choose either True or False.
Have you tried a User cell, say User.Front, set its Value to True, and than reference it from the Sub-Shape. Just for experiment, to see, where the error may be?
Title: Re: Different line patterns in one shape?
Post by: cookiejar on February 17, 2010, 07:42:33 AM
vojo, your attachment works fine. I created a new shape and it seems to be working. Weird. Anyway, thanks a lot for all the replies.