We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2024-07-22 08:06 AM
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.
This is what I see in 22.
But in version 25+ it does not work.
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.
2024-07-22 08:37 AM
Hi Barry Kelly,
maybe because the value custom is a comment on the first line ?
2024-07-22 09:08 AM
No that is not it.
I just scripted that out to see if it did make a difference and it doesn't.
Thanks,
Barry,
2024-07-22 09:53 AM
Does the bug still happens if you run the Parameter script once ?
2024-07-22 09:59 AM
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.
2024-07-22 10:11 AM
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.
2024-07-22 10:15 AM
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.
2024-07-22 10:58 AM
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.
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.
2024-07-22 03:06 PM
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
2024-07-23 04:46 AM
@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.