We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-04-30 03:39 AM - edited 2023-04-30 03:48 AM
Hi All
I have created a label that extracts data from Walls. When placed, it is positioned parallel to the Wall. I have used a Request statement to get the width of the relevant data text to create a 'pill-shaped' frame (incl. fill). This label also has a custom leader that points to the element (Archicad's Pointer is not used). This is all working well. What I would like to do (something I'm struggling with and seeking help on) is to be able to dynamically move the 'pill-shaped' frame to three different fixed positions along a single axis (parallel with the Wall). I have already coded a dynamic hotspot to run along this axis, and the 'pill-shaped' frame runs along with no problem, but it is infinite. I want it to be fixed to three positions. Refer to the attached image for where I would like the positions fixed. From my exploration and testing, I can't get the text width into the Parameter script (where I'm trying to fix these positions with a Value statement). FYI my Value statement looks like VALUES "dynamicOffset1m" RANGE [-0.0015,0.0015] STEP 0, 0.0015. I'd like to replace the '0.0015' with text width calculations. Does anyone know how to achieve this? Thanks in advance!
Solved! Go to Solution.
2023-05-04 01:57 AM - edited 2023-05-04 02:00 AM
Hi Brendon,
I think I have managed to come up with a solution thanks to Peter's comment. Peter gave me an idea which seemed to have worked. Although I didn't use GLOB_FEEDBACK_MODE, I used a variable in the 2D Script that forces the hotspots to not exceed the beginning of your curve via an if statement. I have attached the file.
Cheers,
Shaun.
2023-05-01 03:38 AM - last edited on 2023-05-03 08:17 AM by Laszlo Nagy
Just off the top of my head without testing, wouldn't you just use the width value you got from the REQUEST?
i.e the same parameter/value you use to set the text box width.
Assuming the returned parameter is 'box_wid'
Something like ...
VALUES "dynamicOffset1m" -box_wid*0.5, 0, box_wid*0.5
I wouldn't use STEP, just give the 3 values you want to use.
Barry.
2023-05-01 04:34 AM
Hi Barry
You would think that is the obvious solution! Although, unfortunately you can't get the 'box_wid' value as it is REQUESTed (and transformed with GLOB_SCALE) in the 2D Script. I have tried moving the REQUEST statement to the Parameter Script, but you get a 'Project dependent request' error.
Thanks
Brendon
2023-05-01 06:34 AM
Since you are just having it snap to the sides, and each label maybe different, why not just have it be:
VALUES{2} dynamicOffset1mfg -1, Left, 0, None, 1, Right
Since the positions are set to nodes on the pill, the actual offset is kind of irrelivant to the user. Then in your script you just have a transformation which is dynamicOffset1mfg * box_wid.
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2023-05-01 06:38 AM - last edited on 2023-05-03 08:18 AM by Laszlo Nagy
Hi BR,
Yes! I always wanted to use the text string width for moveable hotspots but couldn't work out how.. as a workaround.. I'm using the custom leader to toggle between 3 anchor points.
DEFINE STYLE "tzg_marker1" LABEL_FONT_NAME, LABEL_TEXT_SIZE, ANCHOR, LABEL_FONT_STYLE
(Anchor set to 7, 8, or 9)
Let me know if you find a way to limit the hotspot points based on return values!
2023-05-01 06:40 AM
Hi Ling
That is in fact my fall back. But unfortunately this is not so great, as the 'text box width' will vary due to the called Wall data and scale of the View! Maybe I have encountered a limitation!
2023-05-01 06:42 AM
Hi Kev!
Yes this is an option too. Maybe it is a limitation! How good would it be to have a fix though!
2023-05-01 06:49 AM
Hi Kev
Upon having a closer look, I think there is definitely something in your suggestion worth exploring... I think I can move the frame the required distance no matter how long the length of text using this method. Now if I can only get a dynamic hotspot to link to the 'Anchor'... I'll give this a go and let you know! Thanks!
2023-05-01 01:21 PM
I attach an example from a stretchable cabinet.
2023-05-01 02:23 PM
Thanks Joachim - much appreciated. Unfortunately, these fixed points are not tied to an output scale (e.g. 5mm at 1:100, or 15mm at 1:50). What makes my request even more complicated is I'm trying to tie my fixed points to a length that will vary depending on the width of the RICHTEXT block.