Smart Arrow Behavior with a Group of Shapes

Started by Chance0066, September 01, 2011, 01:57:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chance0066

I'm new to Shapesheet, but I'm catching on fairly well by reading Visio Guy's articles, but I'm not finding the answer to the question I have anywhere.

I have a shape that is made up of two child groups and one basic rectangle. I want this shape to work almost exactly like a smart arrow would. I want to be able to click on the shape and elongate it with only the rectangle getting longer, while the child group keep their aspects. Although, I have not even figured out how to do this, the problem gets further complicated when I take into account that I need to be able to resize the shape as well.

To put it exactly, I work with pipe, and I'm trying to create a smart shape that can be any length, but then be made bigger or smaller while keeping it's aspect ratio. The two ends of the shape are defined by their own group of shapes and those groups need to keep their aspect, but the length of the rectangle represents the pipe itself and can be elongated. I don't know if this is all possible is a single shape, but I have been trying to find out for a couple of days now. I hope someone here can help.

Jumpy

You could post a picture or vsd here, so it's more easy to understand, what you need.

What I think so far:
If you group the rechtangle and the childgroups, that make up your arrow-ends, than go into the ShapeSheet of a child group, you'll see formulas in Width, Height, PinX, PinY that depend on the group.
If for example the groupname is Sheet.123 in the Width of a subshape could stand sth. like =Sheet.123!Width*0.3276.

Because of that dependency resizing the group leads to resizsing of the childsshapes.
To prevent that, change the formulas in the child to fixed values, e.g. Width = 2 mm,
and even better, use the Guard funtion, to prevent accidental changing of the formula:
Width = GUARD(2 mm).

Chance0066

You seem to understand exactly what I'm talking about. I had considered that solution, but wouldn't that, then prevent me from being able to resize the whole shape after I had elongated it? Would a possible solution to this be to insert a formula that guards the width but not the height. Then, make the width dependent on the height such as:

Width = GUARD(Height*(1.2))

Also, if I understand you correctly, the "Sheet.123" portion of the formula causes that dependency. Eliminating this would mean I could not resize the shape as a whole after it is elongated. You'll see that the shape in the .vsd is very small, and for our purposes it needs to be so. However, once a diagram is pieced together we often increase the size of the whole thing to make it easier to read. I'm worried that I might have a case of "Wanting to have my cake and eat it too" here.

wapperdude

#3
Not difficult.

First, make the placement of the two end pieces related to the "body" piece (e.g., Sheet.123) by formula.  That is, don't glue.
    >> For the end piece on the right, set LocPinX to width*0. 
    >> Set pinx = Sheet.123!PinX+sheet.123!Width*0.5.  Guard the formula.  This locks the right end piece to the end of the body.
    >> Do similar for left end piece, except LocPinX = width*1, and 2nd formula uses -Sheet.123!Width*0.5.

This allows the pipe to be any length and the end pieces to be at the ends!

Now, slave the heights.  That is, set the height of each end piece = height of pipe piece, e.g, height =guard(sheet.123!height).

Finally, keep end piece aspect ratio:  set width = height.

HTH
Wapperdude

PS>  You need to lock the vertical positions together, each end piece should have PinY = guard(sheet.123!PinY).
Visio 2019 Pro

Chance0066

Sounds really good, but if I did that I wouldn't be able to group the shapes together if I understand you correctly. The shape would have to be saved and then easily usable by people that have next to no experience with Visio. I'm pretty much tasked with creating these shapes, and then making them dummy proof.

wapperdude

Dumby proof is always extra work.   :P

But, in this case, you could
    a.  group everything.  It will still work.  The group box may get a little weird.  Or,
    b.  make everything reference the group shape. 
    c.  Perhaps the easiest way would be slight change in formulas for the end pieces.

Instead of sticking them beyond the end of the pipe body, recess them.  This way, the length of the overall shape is length of pipe, end to end.  Now when you group, the length of the group is still the length of the pipe.

Wapperdude

Visio 2019 Pro

Chance0066


Chance0066

Worked it all out and it works really great. Now I won't have to make a shape for every different length  :D. Unfortunately, I was hoping to be able to lengthen the whole group, but have only the pipe lengthen. With this method, someone using the shape would have to click on shape, then the pipe within the shape to resize it. It doesn't seem like there's a way to actually lock the two end pieces from being elongated without locking them from being able to be resized at all.

wapperdude

Should have worked.  See attached.  Unless I misunderstood. 
Visio 2019 Pro

Chance0066

You're right. I compared my shape sheets to yours and the problem was that I tried to use the "Lock Aspect" protection instead of manually setting the aspect. I was being lazy I suppose because I didn't want to work out the ratio between the size of the pipe and the size of the end points, as they are different. You guys are really great here, hoping to be putting in some of my own input someday.