We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2024-04-10 11:16 AM - last edited on 2024-09-24 10:11 AM by Doreena Deng
Hi!
I tried looking into GDL scripting to add an option to have a column table base in the "Office Table 27". Unfortunately the whole idea of GDL scripting goes way over my head and I can't find any helpful tutorials online.
I really like using the Office Table as a regular table as it gives you so many different options in terms of table top shapes and edge profiles. However I sometimes need to use tables with a column base (screenshot attached). I have created a gsm object that looks like the screenshot attached, however it is not editable for when the size, height or tabletop shape change
Anyone know how I can change the script to include this table leg style?
TIA
Operating system used: Mac Apple Silicon 14 Sonoma
2024-05-10 04:27 AM - last edited on 2024-05-11 05:20 AM by Laszlo Nagy
Hi!
I'd suggest you to do the following steps if you really want to customize this object.
1) 'Save as' the Office Table with other name at first and save the leg macro 'fa_tableleg_macro' with other name, as well (for example, 'fa_tableleg_macro2').
2) Change the macro 'call' to 'fa_tableleg_macro2' in Office Table Parameter/UI/3D scripts.
3) Expand gs_leg_type_string array to [7] and add your new option in Office Table master script like below:
if GLOB_MODPAR_NAME = "gs_leg_type" then
gs_leg_type_m = 1
if gs_leg_type = gs_leg_type_string[2] then gs_leg_type_m = 2
if gs_leg_type = gs_leg_type_string[3] then gs_leg_type_m = 3
if gs_leg_type = gs_leg_type_string[4] then gs_leg_type_m = 4
if gs_leg_type = gs_leg_type_string[5] then gs_leg_type_m = 5
if gs_leg_type = gs_leg_type_string[6] then gs_leg_type_m = 6
if gs_leg_type = gs_leg_type_string[7] then gs_leg_type_m = 7
parameters gs_leg_type_m = gs_leg_type_m
else
gs_leg_type = gs_leg_type_string[1]
if gs_leg_type_m = 2 then gs_leg_type = gs_leg_type_string[2]
if gs_leg_type_m = 3 then gs_leg_type = gs_leg_type_string[3]
if gs_leg_type_m = 4 then gs_leg_type = gs_leg_type_string[4]
if gs_leg_type_m = 5 then gs_leg_type = gs_leg_type_string[5]
if gs_leg_type_m = 6 then gs_leg_type = gs_leg_type_string[6]
if gs_leg_type_m = 7 then gs_leg_type = gs_leg_type_string[7]
parameters gs_leg_type = gs_leg_type
endif
5) Modify UI script of 'fa_tableleg_macro2' like below for showing the new option:
ui_infield{3} "gs_leg_type", x, y, 300, 236,
1, 1, 8, 4, ! ui_legtypes(1).png
90, 116, 70, 90,
1, gs_leg_type_string[1], gs_leg_type_string[1],
2, gs_leg_type_string[2], gs_leg_type_string[2],
5, gs_leg_type_string[3], gs_leg_type_string[3],
7, gs_leg_type_string[4], gs_leg_type_string[4],
3, gs_leg_type_string[5], gs_leg_type_string[5],
4, gs_leg_type_string[6], gs_leg_type_string[6],
1, gs_leg_type_string[7], gs_leg_type_string[7]
6) Finally, write your own 3D model in 3D script of 'fa_tableleg_macro2' when the condition is gs_leg_type_m = 7.
if gs_leg_type_m = 7 then
...
endif