News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

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 :)


Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 205 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1061KB.
Tokens: post-login.
Cache hits: 13: 0.00218s for 26,715 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]