GDL
About building parametric objects with GDL.
SOLVED!

Limiting 2D Symbol dynamic hotspots to a (Value) Range of output units (mm)

Brendon Reid
Booster

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!

 


Dynamic_Hotspot.png
Thanks
Brendon
MacBook Pro (16-inch, 2019), i9, 64GB RAM, macOS Big Sur, Windows 10 (Bootcamp)
Archicad User since 1994
18 REPLIES 18

Refer to window / door marker objects to see how it works:

HOTSPOT2 x, y [, unID [, paramReference [, flags [, displayParam [, "customDescription"]]]]]

the key is "displayparam"

Hi Piotr

Yes, thanks. I do have a Hotspot2 command that utilises displayParam (referring to my image you can see it is called 'Display Offset mm'). Unless I am missing something, the problem is I can't fix that parameter to a RANGE because those values are not accessible in the Parameter script. I'll take a closer look in any case. Thanks again - appreciate your response!

Thanks
Brendon
MacBook Pro (16-inch, 2019), i9, 64GB RAM, macOS Big Sur, Windows 10 (Bootcamp)
Archicad User since 1994

You have to have the both parameters set and "valued" in parameters script.

That is another trick,  and 1024 status is another

Actually I dig some example where there are 3 parameters: the M (meters) MM (millimeters) are real number. But I believe I have some other with just 2 parameters.

 

 

hotspot2 0, 0, unID, extensionLineLengthM, 1+1024, extensionLineLengthMM :unID = unID + 1 !BASE (hidden)
hotspot2 0, 1, unID, extensionLineLengthM, 3+1024, extensionLineLengthMM :unID = unID + 1 !REFERENCE
hotspot2 0, -extensionLineLength, unID, extensionLineLengthM, 2+1024, extensionLineLengthMM :unID = unID + 1 !MOVING

 

ShaunTaylor
Booster

Hey Brendon,

 

I am not sure this can be achieved if your label is sizing based on scale (paper size). Assuming you need to right a "Values "pointPosition" range(..." command in the parameters script. If your label is sizing based on scale, then you can't calculate the range because there is no way of requesting scale in the parameter script.

 

I got close by creating a style in the master script, then by using "stw(myString)". But unfortunately, that doesn't factor in the scale. So, the number I get is only correct using model size and not paper size.

 

I know Graphisoft removed using "glob_scale" in the parameters script in version 20. It would be good if they can give us an alternative to requesting scale from the model.

 

Cheers,

Shaun.


I know Graphisoft removed using "glob_scale" in the parameters script in version 20. It would be good if they can give us an alternative to requesting scale from the model.

It was removed because using it would lead to incorrect state of the object.

Anything in Archicad can have multiple views with different settings, but only one parameter set. Scheduling, teamwork and interoperability features use the parameter set, it can't depend on the last applied view with the BIM approach.

 

A workaround is to give graphical feedback in GLOB_FEEDBACK_MODE. Then the hotspot doesn't have to have a limit, but you still can give hint about the separate options. An editable hotspot can be drawn at a fixed position x: hotspot2 x, 0, unID, editedParam...

Péter Baksa
Software Engineer, Library
Graphisoft SE, Budapest

Thanks Peter - I knew you would have something to share! And thanks everyone for your comments, they are all much appreciated! While I don't have a perfect solution ('by design' for a good reason), I think Peter's use of GLOB_FEEDBACK_MODE (which I never used before) and having fixed hotspots (which can be driven by the text width are great in combination. Refer to attached image. It would be great if Hotspots could be seen only when GLOB_FEEDBACK_MODE = 1 though (unless of course I am missing something)!


Fixed_Hotspots.png
Thanks
Brendon
MacBook Pro (16-inch, 2019), i9, 64GB RAM, macOS Big Sur, Windows 10 (Bootcamp)
Archicad User since 1994
Solution

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.

Brendon Reid
Booster

Hi Shaun

Although my Label works the opposite (my 'pill' moves, not the leader), the functionality provides an even better result! And such a simple way to do it! Thanks for this; much appreciated!

Thanks
Brendon
MacBook Pro (16-inch, 2019), i9, 64GB RAM, macOS Big Sur, Windows 10 (Bootcamp)
Archicad User since 1994
David Shorter
Advisor

Hi Brendon

Doing in the label seems tricky so I made a new label and called the code label as shown in the script.

it needs a directional rotation (for the wall direction) and a moveable hotspot but that shouldn't be difficult.

Just a thought.....

Hope this helps

DavidShorter_0-1683183942471.png

 

Archicad 4.1 to 28 Tech Preview. Apple Silicon
you can't build a line
Mac Studio
iPad Pro
iPhone