Retaining Subshape position when parent group moved/resized

Started by saratogacoach, January 23, 2021, 04:32:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

saratogacoach

Grouped a custom connector with an angled line (for a genogram), need to have the angled line retain centered position when parent group's width is changed via parent group's grab handles.

Not sure how to do this?

Is there a shapesheet formula to change the angled line's position to retain its centering in the parent group as the parent group's width changes? (Please note: Parent group, in addition to being able to widen/contract, also needs to be capable of moving as a whole to be positioned anywhere in the genogram.)

update: maybe something like this, but not sure where it would be put in the shapesheet? : Pages[Page-1]!Sheet.21!Width+(Width/2). When I put this in the subshape's PinX cell, result was not what is needed. This is a challenging formula.  :'(

I am attaching a VSDX file. Grab handles for group at top of each vertical line section. Widen using grab handle, notice angled center line does not dynamically move and reposition to center as horizontal line widens (or contracts).

Any help appreciated to get this working.
saratogacoach


saratogacoach

#2
Hi Croc,

Thank you for sending this suggestion. I tried using the formula in the subshape, but I had no success. (I am testing first without connecting to any shapes. There are many shapes that can be added that need to be connected, so I can not count on any reference to one type shape for a formula in the connector line.)

I also kept experimenting with the formula (see last posting, update) and tried variations for the formula. Again, no success.

I keep thinking that getting the angled line subshape to remain centered on the parent group's horizontal line when that line is stretched should not be that difficult to achieve, but so far, no success with this.  (In pseudocode, this should be getting the beginning and ending X for the horizontal line, dividing by 2 (for a midpoint), setting the subshape's beginning and ending X to that. Something like that... :'(

I will keep searching in this forum, online, experimenting and hope I can figure it out.
saratogacoach

Croc

I thought that to solve the problem, it would be enough to bind an additional label to the middle of the dynamic connector. Further proceeds from this premise. I am not using grouping.
A label (or multiple labels) can be added to the universal connector using additional Geometry sections.
The middle of a connector can be determined using the POINTALONGPATH function.
Let's look at the formulas in the Geometry2 section in the above example.
POINTALONGPATH (Geometry1.Path, 0.5) returns the point in the middle of the connector. Geometry1.Path refers to the main Geometry section of the connector. 0.5 is the relative distance from the beginning of the connector.
PntX and PntY returns the X and Y coordinates of the resulting point.
Thus, the first line of the additional geometry section contains the position of the middle of the connector.
The second line draws a slanted line to a point 0.1 in in X and Y.
This label is drawn for example only. Instead, you can add a vertical line and offset it by the desired distance from the center.
To draw two additional lines you must use two additional geometry sections (Geometry2 and Geometry3).
This solution not uses grouping and associated complexities. It may not work for you. Then I apologize for taking your thought aside.


saratogacoach

#5
Hi Croc,

Thank you very much! I will look carefully at the example, suggestions, to check if this solution can work for the genogram line.

One change I will need to make is that the line must be at -135 deg angle. One genogram connector has a single -135 deg line and a second genogram connector has two side-by-side lines also set at -135 deg. So, I will need to try to modify the VSDX to achieve this, if it is possible?

Again, thank you very much for your kind help.

Best Wishes,
saratogacoach


Croc

There is an improved version with the ability to adjust the line length and distance between lines.
Customization using User-defined cells.
If the distance between the lines is 0, then they look like one line.

saratogacoach

#8
Thank you, Croc.

There is one problem, but I think it is not the line, but instead my circle shape. I built a circle, added it to a new stencil with the genogram shapes.

As you can see from the screenshot, the circle has a "ghost" shape in addition to the circle. Not sure why? Maybe I will need to re-create the genogram circle shape, with connectors, replace it in the genogram stencil. Hopefully that will eliminate the "ghost" image for the circle?



I am also attaching my VSDX with the shapes (including the "ghost" shape).

update: adding the circle shape with "ghost" shape breaks the line-cannot select the line

Thank you again.
saratogacoach

Croc

saratogacoach,
I don't know how and why you made such a shape. But I can describe what happened.
Now "circle" consists of three shapes:
Sheet.12 - group
Sheet.13 - circle is a member of the group.
Sheet.8 - 1D shape, which is not a member of the group, but bound to it by formulas in the EndX, EndY cells.
The operator can "tear" the Shape Sheet.8 from the group and then it will not be associated with it. That is, the costruction looks somewhat unreliable.
But since I do not understand the plan, I can not advise anything.

saratogacoach

Yes, unfortunately many of my original genogram shapes are defective. I was, and still am, learning. I only have Visio for a few weeks now, so I still have much to learn.  :-[

Re: circle-it is a problem with my stencil circle shape. So, I just added a new square shape and a new circle shape (from general shapes) to the genogram stencil. These work OK with the connector line-no "ghost" shape.

I will need to fix most of the other connector lines and some of the shapes in my genogram stencil, since I created and added them to the stencil when I was still learning. The connector lines are especially challenging because the only way that I could create them was by grouping. Grouping as you mention can cause many potential problems. So, maybe I can learn how to create these other connector lines by following your example.

Thank you again for helping with this connector line. Works great and provides me with helpful learning about another way to achieve these results.

saratogacoach


saratogacoach

#12
Is there a way to re-create the square and circle shapes that have 4 separate quadrants? These are used in a genogram to symbolize health conditions (for example diabetes or heart disease). Each illness is given a separate color in one of the 4 quadrants. (Since there are many illnesses, fill color is changeable to any color, so that it can use a custom fill color.)

My current genogram stencil 4-quadrant square and circle shapes no longer work or correctly connect, probably due to all of the grouping of the separate quadrants to total the complete shape. Can the 4-quadrant square and circle be re-created without grouping? Maybe by using shapesheet drawing? If yes, how?

VSDX file illustrating 4-quadrant color shapes attached.
saratogacoach

Croc

In the case of a square and a circle with 4 quadrants, the grouping is quite justified. So it makes sense to figure out what's broken and fix it without giving up grouping.
What does it mean - "do not connect correctly" more specifically?
Have they connected correctly before?
Can I see examples of a "correct" connection?
It is quite possible that it will be enough to change the type of the original connector (instead of the dynamic one, use something else). But first, you need to explain the required behavior in as much detail as possible.

saratogacoach

#14
Thank you for your help. Happy to try to provide more information.

I am attaching a revised VSDX file that illustrates the 3 types of connector lines (marriage #1, separation #2 and divorce #3) and their use to connect 4-quadrant color shapes. I have also added comments to each example line.

All of these connectors should be able to display the 2 vertical side line-elements, as well as the central horizontal line when connected between two 4-quadrant color (or plain, no-color, no-4-quadrant) shapes.

The marriage connector line (#1) and the two 4-quadrant color shapes can correctly connect.

However, the connector line symbolizing separation(#2) and the connector line symbolizing  divorce (#3) is not able to connect to each 4-quadrant color shape using one of its two vertical line elements (on each side of the line's central horizontal connector line). Sometimes one vertical line can connect but then the other vertical line is not able to connect to the other 4-quadrant color shape. So, not both. Sometimes none of the vertical lines are displayed no matter how they are moved around to try to connect with the 4-quadrant shape.

Hope that is a better explanation and illustration. Please ask for any additional explanation if needed. Happy to add more details, graphics, etc.

Thank you very much for your kind help.
saratogacoach