License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
GDL
About building parametric objects with GDL.
SOLVED!

Deprecated parameters & variables...shouldn't be (sometimes)

Bruce
Advisor

I know Graphisoft had what they considered ironclad reasons for deprecating the parameters that they did, and I've had these conversations before.  But it is still causing me grief, and I am still unconvinced it needs to be this way. 

 

Two examples:

1. GLOB_NORTH_DIR: I am scripting parts that test for compliance with the local planning guidelines.  One of these is a balcony check that is dependent on the orientation of the balcony: north, south, east west.  I should be able to check this against the GLOB_NORTH_DIR...but this isn't available in the parameter script, which means I now must rely on the user to manually enter the Project North in the part.  

2. REQUEST("Profile_components"...:  I have scripted an all-purpose surface label that gets around the shortcomings of the Archicad one.  It will read from doors, windows, objects,...and complex profiles.  One of the functionalities I would like to include is the ability to filter the surfaces in the complex profile for the user to select from.  This can't be done in the parameter script, so the user is left selecting from the entire project surface catalogue, and the labels tests the validity of the selection after the fact: rather backwards.

 

I don't see any problem with the management of attributes and their impact on objects being left to the BIM managers of the file, and not being locked out of this functionality.  There are plenty of examples where this happens currently (e.g. changing a scheduling parameter in the script).

Bruce Walker
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb
2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution
Peter Nagy-Barta
Graphisoft
Graphisoft

Dear Bruce!
From AC 20 the Project- and View Dependent Globals and many Requests have been restricted in Parameter Script (and Master Script as well), such as the two mentioned in this topic.

The main reason behind the restriction is that the parameter script (parameter consolidation) should not be run in case of changing something on the view or in the project settings (such as changing the North Direction, View Scale, Origin Location, etc. or editing Complex Profiles or Composites). The other reason is that this globals and requests can't run parameter consolidation during TeamWork.

For further information you can see the GDL Reference Guide at https://gdl.Graphisoft.com/ or the PDF added to the Archicad's Documentation folder.

 

Best regards,

Peter

Peter Nagy-Barta
Senior Software Engineer

View solution in original post

Solution
Peter Baksa
Graphisoft
Graphisoft

Is the parameter script the only way to solve these needs?

  1. You can do the check in the 2D script and draw the balcony in red (or don't draw it at all) if the orientation is not correct. You could change the 2D appearance only for listing context (maybe adding an MVO setting to not have an effect on all schedules).
  2. ui_infield can be filtered in the UI script too. Your case needs a workaround, as filtering is only available if VALUES are set in the parameter script, but we don't know how many surfaces are there in the plan. SelectedSurface needs to be an integer parameter, surfaces can't be filtered currently. It might work better with UI_CUSTOM_POPUP_INFIELD, I haven't tried that.

parameter script:

dim vals[], strings[]
for i = 1 to 32000
    vals[i] = i
    strings[i] = str(i, 1, 0)
next i

values{2} "SelectedSurface" vals, strings

UI script:

ui_infield{3} SelectedProfile, 0, 0, 200, 24
n
= REQUEST ("Profile_components", SelectedProfile, nComponents)

! set up filter
dim
pics[], strings[], vals[]
for i = 1 to nComponents
    iSurface = 0
    n = REQUEST{4} ("Profile_component_info", SelectedProfile, i, "gs_profile_surface", iSurface)
    sSurfaceName = ""
    n = REQUEST ("Name_of_material", iSurface, sSurfaceName)

    pics[i]     = 0
    strings[i]  = sSurfaceName
    vals[i]     = iSurface
next i

! currently selected surface might not be available in selected profile
sSurfaceName
= ""
n = REQUEST ("Name_of_material", SelectedSurface, sSurfaceName)

ui_infield{3} SelectedSurface, 0, 25, 200, 24,
    8, 0,
    0, 0,
    0, 0, 0, 0,
    0, "selection: " + sSurfaceName, SelectedSurface,
    pics, strings, vals

! check result
ui_outfield sSurfaceName, 210, 30, 200, 19
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

View solution in original post

6 REPLIES 6
Solution
Peter Nagy-Barta
Graphisoft
Graphisoft

Dear Bruce!
From AC 20 the Project- and View Dependent Globals and many Requests have been restricted in Parameter Script (and Master Script as well), such as the two mentioned in this topic.

The main reason behind the restriction is that the parameter script (parameter consolidation) should not be run in case of changing something on the view or in the project settings (such as changing the North Direction, View Scale, Origin Location, etc. or editing Complex Profiles or Composites). The other reason is that this globals and requests can't run parameter consolidation during TeamWork.

For further information you can see the GDL Reference Guide at https://gdl.Graphisoft.com/ or the PDF added to the Archicad's Documentation folder.

 

Best regards,

Peter

Peter Nagy-Barta
Senior Software Engineer
Solution
Peter Baksa
Graphisoft
Graphisoft

Is the parameter script the only way to solve these needs?

  1. You can do the check in the 2D script and draw the balcony in red (or don't draw it at all) if the orientation is not correct. You could change the 2D appearance only for listing context (maybe adding an MVO setting to not have an effect on all schedules).
  2. ui_infield can be filtered in the UI script too. Your case needs a workaround, as filtering is only available if VALUES are set in the parameter script, but we don't know how many surfaces are there in the plan. SelectedSurface needs to be an integer parameter, surfaces can't be filtered currently. It might work better with UI_CUSTOM_POPUP_INFIELD, I haven't tried that.

parameter script:

dim vals[], strings[]
for i = 1 to 32000
    vals[i] = i
    strings[i] = str(i, 1, 0)
next i

values{2} "SelectedSurface" vals, strings

UI script:

ui_infield{3} SelectedProfile, 0, 0, 200, 24
n
= REQUEST ("Profile_components", SelectedProfile, nComponents)

! set up filter
dim
pics[], strings[], vals[]
for i = 1 to nComponents
    iSurface = 0
    n = REQUEST{4} ("Profile_component_info", SelectedProfile, i, "gs_profile_surface", iSurface)
    sSurfaceName = ""
    n = REQUEST ("Name_of_material", iSurface, sSurfaceName)

    pics[i]     = 0
    strings[i]  = sSurfaceName
    vals[i]     = iSurface
next i

! currently selected surface might not be available in selected profile
sSurfaceName
= ""
n = REQUEST ("Name_of_material", SelectedSurface, sSurfaceName)

ui_infield{3} SelectedSurface, 0, 25, 200, 24,
    8, 0,
    0, 0,
    0, 0, 0, 0,
    0, "selection: " + sSurfaceName, SelectedSurface,
    pics, strings, vals

! check result
ui_outfield sSurfaceName, 210, 30, 200, 19
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
Bruce
Advisor

Thanks Peter.  How do I schedule the orientation of a balcony using these methods?  I need to produce a schedule that not only shows the orientation of the balcony (N, S, E, W), but also whether its m² complies - which is dependent on its orientation.  To my knowledge, I can only schedule parameters.

Bruce Walker
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb

You can show 2D in schedule, and use GLOB_PREVIEW_MODE = 2 to draw the result of the validation.

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
Bruce
Advisor

That would then be a 2D preview, as opposed to a text field, right?  Even if the preview was text (via TEXT2 / RICHTEXT2), it wouldn't be exportable / sortable as a text field?

Bruce Walker
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb

That's true.

Maybe it could be done with a property expression without GDL? Almost - "Area" is available for objects as AxB, but "Angle from North" is for Curtain wall panels only. I will ask why we restrict that.

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest