Locking Text and Objects inside shapes while allowing the parent shape to scale

Started by ksauce, March 13, 2023, 07:53:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ksauce

Hi all,

I'm having an issue trying to lock my text box and icon inside the top portion of the box as show in fig.1. Im trying to keep the "Title" text inside the middle of the black background area but also scale on the x-axis, which seems to be working but I cannot keep the "title text" or icon locked on the y-axis as shown in both Figure 2 and 3. both the text and icon progressively move downward as its taking calculations from the parent shape. Im relatively new to this and have tried using the "GAURD" command which seemed to work on some shapes decently, but as it goes with text boxes I cannot seem to figure this out.

There is the suggestion of putting the text inside the top shape that's already locked and working, but these custom stencils were modified from Visio's built in org chart stencils so it maintains the position types and actions that get applied when dragging and dropping these on top of other shapes to create connection lines etc. So I've been using the text box that was previously provided to maintain all these commands/actions

I'm assuming I have to lock the objects to the shapesheet.#! that specifies the black background object but I have had no luck figuring that out with the Text block format or text transform options within the shapesheet of the object.

Any suggestions would be greatly appreciated!









Yacine

Setting up a new smartshape as you need it is not difficult.


However you explanation suggests that you are using a built-in visio solution, which makes it more difficult to use - not knowing what Visio may overwrite.


Can you provide information on the solution you're using, or upload an example?
Yacine

vojo

shapesheet
look up the guard function and use it for location and dimensions in shapesheet

ksauce

Just want to reply and leave the answer here as I was able to figure things out using some key points from this thread that may seem simple to most.

http://visguy.com/vgforum/index.php?topic=5271.0

Quote from: wapperdude on January 03, 2014, 12:09:18 AM
Not that difficult.
> Open shapesheet for the "top" shape. 
> Set LocPinY = Height*0.
>  Make note of the shape ID, e.g., sheet.1
> Close shapesheet.

> Open shapesheet for the lower shape.
> Set LocPinY = Height*1
> Set PinY = Guard(Sheet.1!PinY)  where Sheet.1 is the ID of your top shape.
> Set PinX = Guard(Sheet.1!PinX)
> Close shapesheet.

The last two "sets" lock the lower shape to the upper shape.  The two LocPinY sets the edges of the two shapes so that they will align correctly.

That's it.
Wapperdude


I needed to modify the text and not an object, so it was done in the text transform section. I thought I just needed to assign TxtPinY to sheet.#!) I didn't realize I also had to enter the text PinY variable as well, I also had to assigned the TxtLockPinY a static value so it wasn't using calculations to determine it's position. These seemed to solve everything. Thanks again everyone :)