Archi Forum

Archi Plug-ins => jArchi => Topic started by: Thomas Rohde on November 16, 2022, 06:13:12 AM

Title: Snippet: Attaching labels to view elements
Post by: Thomas Rohde on November 16, 2022, 06:13:12 AM
This gist attaches a label (a "note") to the lower left, in red text, of all elements in a selected view, or all elements of the same type as a selected element.

You are presented with a selection list of all possible properties. Pick one to use as a label. If you cancel the dialog box, then all currently attached labels will be deleted.

The gist depends on this library (https://github.com/adambisek/string-pixel-width) to calculate the width of the notes based on the string length of the label (property).

label.png

Link to gist. (https://gist.github.com/ThomasRohde/7a9282c5528c8a72fb09c872e825f678)
Title: Re: Snippet: Attaching labels to view elements
Post by: Phil Beauvoir on November 16, 2022, 07:28:39 AM
Thanks for sharing these gists, Thomas!

Regards,

Phil
Title: Re: Snippet: Attaching labels to view elements
Post by: rchevallier on November 28, 2022, 13:21:52 PM
Also another simple way to add extra info to a visual object without a jArchi script

Using a note with label formula as $parent{property:timeframe} to retrieve property info from the visual object. Usually created by copy and paste, quick and efficient.

Capture d'écran 2022-11-28 141256.png