Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.
2023-03-28 07:01 AM - edited 2023-03-29 03:38 AM
Hi all,
Is there a way to scale a parameter used by a dynamic hotspot? My parameters are in Layout units, so they are set to the View, and I would rather not need to make a set of intermediary parameters to convert it for graphical editing...
paramReference / GLOB_SCALE
HOTSPOT2 (marker_length) * GLOB_SCALE, lsg_elevation, lsg_uID, marker_length / GLOB_SCALE, 2+1024 : lsg_uID = lsg_uID +1 !Left moving
Ling.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |
Solved! Go to Solution.
2023-03-28 02:06 PM
Yes, there is a way: Add '1024' to the type bitmask. Then the parameter will be measured in paper space (not in model space).
2023-03-29 03:43 AM - edited 2023-03-29 03:48 AM
It would appear that the reference guide description is inaccurate. 1024 works.
Flag 1024: use paramReference value as meters in paper space.
This line in the reference guide should be rewritten as:
Flag 1024: scale paramReference value to View scale
Ling.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |
2023-03-28 10:34 AM
I think the units are tied to the project working unit. As you have suggested the only way round that is with intermediate parameters and using the "displayParam" option in the Hotspot settings.
2023-03-28 02:06 PM
Yes, there is a way: Add '1024' to the type bitmask. Then the parameter will be measured in paper space (not in model space).
2023-03-29 03:27 AM - edited 2023-03-29 03:29 AM
Doesn't that just converts the input into meters, so scales the input by 1000. "Units" was probably the wrong word to be using... I am scaling to the Layout, so if the View is 1:50, I need to scale the input by 50, but if it's 1:20, I need to scale it by 20.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |
2023-03-29 03:43 AM - edited 2023-03-29 03:48 AM
It would appear that the reference guide description is inaccurate. 1024 works.
Flag 1024: use paramReference value as meters in paper space.
This line in the reference guide should be rewritten as:
Flag 1024: scale paramReference value to View scale
Ling.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |
a week ago - last edited a week ago
Hi,
I am having a similar problem, but I am not sure this solution works for me (or I am just doing it wrong).
I have an object that I place into the model space, but it scales itself to paper size. I have 2 pieces (in practice a marker and a text box, but in the example below I just use a line and a box), that I need to be able to adjust compared to each other.
The line and the box are both paper size, so the X/Y distance between them also need to be paper size. All my parameters are floats/real numbers (because the length would be in model space units, and I just want them to be mm).
So, I have an X and a Y parameter, both real numbers in mm, that you can change on the UI, and it moves the box compared to the line. But I just cannot make it work with an editable hotspot. whatever I do, it just won't work...
PAPER_TO_MODEL = GLOB_SCALE / 1000
_x = x_paper * PAPER_TO_MODEL
_y = y_paper * PAPER_TO_MODEL
line2 0, 0, 0, 1
add2 _x, _y
rect2 0, 0, 1, 1
del 1
unID = 1
hotspot2 0, 0, unID: unID = unID + 1
hotspot2 0, _y, unID, x_paper, 1 + 128 : unID = unID + 1
hotspot2 _x, _y, unID, x_paper, 2 : unID = unID + 1
hotspot2 -1, _y, unID, x_paper, 3 : unID = unID + 1
hotspot2 _x, 0, unID, y_paper, 1 + 128 : unID = unID + 1
hotspot2 _x, _y, unID, y_paper, 2 : unID = unID + 1
hotspot2 _x, -1, unID, y_paper, 3 : unID = unID + 1
What am I doing wrong?
a week ago
Hey Daniel,
as far as I can tell this does never work if you do not "shadow" the parameters.
You will need to have the values in both real dimension and millimeters.
So, I call my millimeter one x_mm
and my real dimension one xx
.
Now I tie them together in the Master/Param script:
!// Master/Param script:
if GLOB_MODPAR_NAME = "xx" then parameters x_mm = xx*1000
if GLOB_MODPAR_NAME = "x_mm" then parameters xx = x_mm/1000
This gives me the possibility to do this in the 2D script:
!// 2D script
line2 0, 0, 0, 1
_x = xx * GLOB_SCALE
add2 _x, 0
rect2 0, 0, 1, 1
del 1
unID = 1
hotspot2 0, 0, unID : unID=unID+1
hotspot2 0, 0, unID, xx, 1+128+1024, x_mm : unID=unID+1
hotspot2 _x, 0, unID, xx, 2, x_mm : unID=unID+1
hotspot2 -1, 0, unID, xx, 3, x_mm : unID=unID+1
So, why does this work?
x_mm
will always hold the value in Millimeters. But we need to work with the real dimensions in GDL, so we cannot use that: We need the value in Meters, which is obviously mm times 1000. We sync both values so it does not matter what the user changes, the other value will always be correct.
The 1024
always only operates on the 'paramRef' (after the unID). Again, we can only use real dimensions (Meter) in GDL commands, so there is no chance to substitute it here with x_mm. Also there is no flag to reverse from mm to m, only the other way around.
You obviously want however the user to show the value in Millimeter and enable them to put in a value in mm as well. That's why we use the x_mm as the 'displayParam'.
And lastly because the '1024' only does its magic when the Hotspot is in use we need to manually go from "xx" to "_x" by multiplying it with GLOB_SCALE and putting it in as the position for the hotspot.
Not the easiest thing to wrap your head around, I agree! 🫨
Wednesday
Don't only Length parameters get interpreted as mm?
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |
Wednesday
Length parameters are shown in whatever working unit you have Archicad set to.
In GDL they are always interpreted as meters.
If you use a real number or integer, they will be interpreted as meters.
I have never tried coding an object for 'imperial' units, so not sure how that works.
Length units will be in feet/inches, but the code I believe is still meters.
Barry.
Wednesday - last edited Wednesday
I was more wondering what the point in using a Real Number parameter together with a Display parameter instead of just using a Length parameter. I do not get this comment...
All my parameters are floats/real numbers (because the length would be in model space units, and I just want them to be mm)
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |