cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

GDL
About building parametric objects with GDL.

Why does parameter update works differently for doors in 25+

Barry Kelly
Moderator

I hope I can explain this clearly.

Sample version 22 objects are attached.

 

I have a door object that works perfectly fine in version 22.

It has a parameter list of widths (parameter A) and a matching parameter list of door leaf sizes sizes and a parameter for the number of door.

I have used GLOB_MODPAR_NAME to say when the number of door leaf is changed, the overall width (A) should change as well - simply the number of door x the door leaf width.

 

I have simplified the code to what is in the attached objects (parameter script).

 

values "size" 0.72,0.82!,custom

values "a" 0.72*numdoor,
	0.82*numdoor!,				!!!!! if I un-comment these two lines
	!custom						!!!!! then it will work correctly



if GLOB_MODPAR_NAME = "numdoor" then
	a=size*numdoor
	PARAMETERS a=a
endif

 

So it is very straight forward.

If I change the parameter for the number of doors, the value of A should change.

Which it does perfectly in version 22.

 

Now exactly the same objects used in version 25 - the door does not work properly.

Change the number of doors in the parameter to 2, the object settings show the correct value in the object settings, press OK, the info box briefly shows the correct value and then it changes to the firs value in the value list for A.

It should not do this.

 

i.e A =820, number of doors  =  1 and door leaf width (size) = 820.

Change the number of doors to 2, then A should become 1640.

Instead it becomes 1440, which is 2 times first value in size list.

 

Oddly if I create an object with exactly the same code, it works in both 22 and 25.

Object and door object are attached - pleas try for yourself.

 

If I add a 'custom' size to the parameter list for A, then is also works, but the problem is I would rather not allow a custom size for A.

I want a fixed list of sizes.

 

BarryKelly_0-1721627202536.png

 

This is what I see in 22.

 

BarryKelly_1-1721627331869.png

 

But in version 25+ it does not work.

 

BarryKelly_2-1721627462419.png

 

 

Does anyone know of a reason why it does not work?

@Peter Baksa if you have time to look at this it would be appreciated.

 

Attached is a short video as well.

22 is on the left, 25 is on the right.

Pause at 19 seconds and you will see info box shows 1640 for width (A) then changes to 1440.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
14 REPLIES 14
BrunoH
Expert

Hi Barry Kelly,

 

maybe because the value custom is a comment on the first line ?

Capture d’écran 2024-07-22 à 08.32.42.png

ArchiCad 3.43 to 26
MacOS Monterey

No that is not it.

I just scripted that out to see if it did make a difference and it doesn't.

Thanks,

 

Barry,

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
MF BIM
Enthusiast

Does the bug still happens if you run the Parameter script once ?

https://mfbim.fr | https://youtube.com/@mfbim
AC24 FRA 7600 - AC26 FRA 4027 | MacBook M1 Pro

Hi,

 

I think your script can't work properly even if you un-comment the two lines because you calculate the "a" value only if the "numdoor" value change but you can change the "size" value and then need to re-calculate the "a" one.

I think you just have to calculate the "a" value each time so just delete the "if GLOB_MODPAR_NAME = "numdoor" then" and the "endif" lines.

Or if you want different actions regarding the modified parameter you'll have to set a "if GLOB_MODPAR_NAME" sequence for each one.

ArchiCad 3.43 to 26
MacOS Monterey

I have tried but I will check again.

I have tried checking if it the 'isfirstrun' for the entire script as well as just parts (just the GLOB_MODPAR_NAME) but no luck.

I even tried the option in the compatibility option to run parameter script once.

No luck.

 

The question is why does it work correctly as an object but not as a door (exactly the same sctipt)

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

The thing is the script works fine in version 22 but not in 25.

I am not sure at what version it changed as I skipped from 22 to 25.

I will have to do some investigating on that.

 

And odd that the exactly the same script works if saved as an object, but not when saved as a door.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Barry Kelly
Moderator

It has something to do with the parameter list for A being size x numbdoor.

 

If I set the parameter list to fixed values ... VALUES "A" 0.72, 0.82, 1.44, 1.64

Then it works OK.

 

But again why is being saved as a door object different to being saved as a regular object?

 

The problem now is my object may have 1 door leaf, 2, 3 or 4 door leaves - even more possibly.

And to complicate it even more the A parameter list also needs to allow for an adjustable frame to door leaf clear and, a double door leaf clearance and even extra intermediate frames for when there are more than to doors.

 

So my real door object A parameter list is more like...

 

values "a" (0.41*numdoor)+(2*frame+2*clearance)+(2*wall_type)+(intframe*(int_frame_wid+2*clearance))+INT(numdoor/2)*dble_leaf_cent_clear,
(0.52*numdoor)+(2*frame+2*2*clearance)+(2*wall_type)+(intframe*(int_frame_wid+2*clearance))+INT(numdoor/2)*dble_leaf_cent_clear,
(0.62*numdoor)+(2*frame+2*clearance)+(2*wall_type)+(intframe*(int_frame_wid+2*clearance))+INT(numdoor/2)*dble_leaf_cent_clear,
(0.72*numdoor)+(2*frame+2*clearance)+(2*wall_type)+(intframe*(int_frame_wid+2*clearance))+INT(numdoor/2)*dble_leaf_cent_clear,
(0.82*numdoor)+(2*frame+2*clearance)+(2*wall_type)+(intframe*(int_frame_wid+2*clearance))+INT(numdoor/2)*dble_leaf_cent_clear,
(0.87*numdoor)+(2*frame+2*clearance)+(2*wall_type)+(intframe*(int_frame_wid+2*clearance))+INT(numdoor/2)*dble_leaf_cent_clear,
(0.92*numdoor)+(2*frame+2*clearance)+(2*wall_type)+(intframe*(int_frame_wid+2*clearance))+INT(numdoor/2)*dble_leaf_cent_clear,
custom

 

 

It is weird how adding 'custom' to the end of the list works.

 

BarryKelly_0-1721638261387.png

 

It seems to use the custom size at first because it is not in the original list of A sizes.

Then it sees that the size is in the new list of values for A and then uses the correct size from the list.

But again it is odd why the door object works differently to an actual object.

 

Maybe I need to look at how the parameter list for A is generated.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Try moving the parameters a =a out of the if statement.

And maybe set it to itself first.

 

If----

Endif

 

a=a

Parameters a=a


@SenecaDesignLLC wrote:

Try moving the parameters a =a out of the if statement.


If I take it out of the if GLOB_MODPAR_NAME statement, it does work.

But it does need to be ...

 

a=size*numdoor
PARAMETERS a=a

 

I am not sure why taking it out of the if statement works, but I will give it a try in my real door object.

Still, why is the way the script work in the door object different to the way it works in a normal object?

That is still a puzzle for me.

 

Thanks,

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11