- Today I’ve a call scheduled with attorney trying to sell his services and I was trying to figure all areas where attorney would be useful.
- As always I outlined everything I could think off
- AND THEN it occurred to me, I can organize my thoughts slightly better visually (which I always wish I could but never do), I finally spent 15 minutes with Tinderbox building on lessons taught by @satikusala & countless queries answered by @mwra
- Please note everything is manual , there’s no smart adornment.
- QS There is a adornment called Export Business (set as SEND BEHIND) ON which 3 other adornments (employees , suppliers , clients) are contained . Is it possible to resize Export Business adornment and by extension resize adornment on it?
Layer22.tbx (113.5 KB) Please have a look at attachment
Not automatically. If you select all 4 adornments and start resizing one of them it re-sizes independently (not can you make groups of adornments into composites). But, if you work out the ratio if the $Height & $Width of the 3 circles in relation to the background adornment, you could make an action (edict, stamp, etc.) to (re-)set the hight/width of the 3 circles to the same ratio once you’ve resized the background adornment.
Note that shapes are drawn from an {x,y} anchor position equating to the top left corner of the bounding box of the shape (so less obvious for a circular shape!). For your sort of venn diagram arrangement you may still need to rearrange the relative positions of the three circles.
Oh, right on! This is super fun. We briefly doing a Venn diagram a couple of weeks ago in the Sat. meetup, love seeing it come to life. Nice job!!!
Would you mind if I used this as a basis for a new lesson? I can add in the automation and some export template to show how a report can be built from this.
Ofcourse !!! Please go ahead , it would be great to see what magic you can do with this .
Hi,
Im afraid I have more qs - How do I set the $height in relationship to another adornment ?
$Height=$Height(Adornment??)??
If you are using a designator you could use adornment †. However, as there’s scope for misinterpretation where you’ve 3 overlapped adornment, I’d use the $Name of the adornment you know you mean - i.e. the background one:
$Height=$Height("Export Business")*N
where N is the ratio of the heights. Let’s say the above adornment uses one quarter the height of the background one, then the code would be:
$Height=$Height("Export Business")*0.25
If the height of “Export Business” was changed to 8, the code above would set the current object to a height of 2.
I don’t think this approach helps with your Venn diagram as for if that gets bigger you want the circles to grow from the central overlap and not their top left points. I guess you could figure the maths for that too, but I think it would be easier just to re-align manually.
†. Note that adornment names are case-sensitive and when used in offset references are not enclosed in quotes.
Thank you again for detailed reply ,
- Using $Name , I’m definitely able to update the Height/Width/XPOS/YPOS for rectangular/squares etc. I love it when I’m able to learn and implement something new
- You are right , for circles this is not a great solution as the shape of the circle indeed keeps changing from oval to circle as the ratio changes. Re-Align Manually is indeed easier .
- I can always try my luck and request @eastgate to look into this for V9 to auto-resize shapes connected.
- I have not yet experienced offset references till now , but will read up on this.
See here for more on offset references. Essentially it is the act of getting the value of an attribute from a different note using a designator or its $Name or $Path. $Name is the most common usage, but the full $Path might be needed if the target object does not have a unique $Name within the current TBX.
This makes sense , for people reading ,assuming my items are in container BB which is in root, it would look like below
$Height=$Height(“/BB/Exports Business”)*.25;
Yes. I’d probably not omit the leading zero on the decimal, given that this has to be parsed out. IOW, is that a full stop, a numerical decimal point or a regex .
token? Using 0.25
makes out intent a bit clearer. These aren’t syntax rules as such, but essentially enlightened self-interest. I try to avoid the parser guessing when I can make my intent clear by being more explicit. Tinderbox is actually pretty good at guessing intent when faced with simple ambiguity like this but I prefer not to roll those dice on purpose.
So, all these are also OK:
$Height=$Height("/BB/Exports Business")*.25;
$Height=$Height("/BB/Exports Business")*0.25;
$Height=$Height(/BB/Exports Business)*0.25;
$Height=$Height("Exports Business")*0.25;
Paths don’t need to be quoted as the opening /
gives the parser sufficient hint that the following section of text is a path. Whitespace around operators (=
, *
, etc.) is ignored in action code so add or omit as you prefer.
$Height=$Height(child)*0.25;
→ get the value from the first child note of this note.
$Height=$Height("child")*0.25;
→ get the value for the note with $Name ‘child’, matching the first by $OutlineOrder if more than one.
$Height=$Height($child)*0.25;
→ get the value stored in the user attribute ‘child’ for this note
$Height=$Height(/Test/child)*0.25;
→ get the value for the note with $Name ‘child’, at $Path ‘/Test/child’ (i.e. avoiding $Name duplication issues.
The $child example shows why it is a good idea to to avoid naming notes (case-sensitively) with titles that are designator names†. Likewise, using attribute naming conventions helps stop accidental but avoidable confusion for the parser.
More:
- Coding conventions in Tinderbox.
- Action code syntax.
- Attribute naming.
†. In cases like me documentation of designators in aTbRef, where such $name values are unavoidable, I’m extra cautious about referencing.
Thank you sharing these nuances . They are very helpful to me at my learning stage !
Very elegant!