cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
GDL
About building parametric objects with GDL.

GDL Scripting to add new table leg option

Sabrina
Booster

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

 

Screenshot 2024-04-10 at 19.01.30.png

 

Screenshot 2024-04-10 at 19.02.17.png

  

1 REPLY 1
LChen
Graphisoft
Graphisoft

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:

    gs_leg_type_string[7] = `SingleLeg`
4) Add the new option for parameter script of 'fa_tableleg_macro2' 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
 
HTH
 

 

Setup info provided by author

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!