We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

Can Renovation status be used for different 2D scripting?

Mats_Knutsson
Advisor
Thinking of trees and using renovation filters... new tree, existing, to be removed... I would like the 2D script to use renovation status....is is possible and/or doable?
/Mats
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
9 REPLIES 9
DGSketcher
Legend
Seems like an important missed variable in GDL. The only apparent access is through Autotext values but I think this is restricted to certain applications such as TEXT2.
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
Anonymous
Not applicable
GDL wrote:
Built-in Properties
These commands return the folder names, parameter names and parameter values of built-in properties on the "Classification and Properties"
tabpage (ID and Categories, Renovation, IFC Properties).
I never tried, but perhaps Build-in Properties can do the trick. (Page 519)
Mats_Knutsson
Advisor
Braza wrote:
GDL wrote:
Built-in Properties
These commands return the folder names, parameter names and parameter values of built-in properties on the "Classification and Properties"
tabpage (ID and Categories, Renovation, IFC Properties).
I never tried, but perhaps Build-in Properties can do the trick. (Page 519)
Hmm..would be interesting to see if it can be used. I'm not that much into GDL to understand how i would use it.
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
Dominic Wyss
Booster
It works but you will get a localized string.
Would be nice if Graphisoft could offer a global integer parameter (-1; 0; 1)

From gdl.graphisoft.com:
DIM folderNamesArray[]
n = APPLICATION_QUERY ("OwnCustomParameters", "GetParameterFolderNames()", folderNamesArray)

for i = 1 to vardim1(folderNamesArray) step 3

    DIM parNamesArray[]
    querystring = "GetParameterNames(" + folderNamesArray + ")"
    n = APPLICATION_QUERY ("OwnCustomParameters", querystring, parNamesArray)
    text2 0, 0, querystring
    add2 1, -1

    _nLines = 1
    for j = 1 to vardim1(parNamesArray) step 3

        parValue = ""
        querystring = "GetParameter(" + parNamesArray + ")"
        n = APPLICATION_QUERY ("OwnCustomParameters", querystring, parValue)
        text2 0, 0, querystring + ": " + parValue
        add2 0, -1
        _nLines = _nLines + 1

    next j

    del _nLines
    add2 0, -_nLines

next i

so in short
renoStatus = ""
_r = APPLICATION_QUERY ("OwnCustomParameters", "GetParameter(Renovation.RenovationStatus)", renoStatus)

text2 0, 0, renoStatus

Cheers
AC27 CHE - macOS Ventura M1
Mats_Knutsson
Advisor
Dominic wrote:
It works but you will get a localized string.
Would be nice if Graphisoft could offer a global integer parameter (-1; 0; 1)

From gdl.graphisoft.com:
DIM folderNamesArray[]
n = APPLICATION_QUERY ("OwnCustomParameters", "GetParameterFolderNames()", folderNamesArray)

for i = 1 to vardim1(folderNamesArray) step 3

    DIM parNamesArray[]
    querystring = "GetParameterNames(" + folderNamesArray + ")"
    n = APPLICATION_QUERY ("OwnCustomParameters", querystring, parNamesArray)
    text2 0, 0, querystring
    add2 1, -1

    _nLines = 1
    for j = 1 to vardim1(parNamesArray) step 3

        parValue = ""
        querystring = "GetParameter(" + parNamesArray + ")"
        n = APPLICATION_QUERY ("OwnCustomParameters", querystring, parValue)
        text2 0, 0, querystring + ": " + parValue
        add2 0, -1
        _nLines = _nLines + 1

    next j

    del _nLines
    add2 0, -_nLines

next i

so in short
renoStatus = ""
_r = APPLICATION_QUERY ("OwnCustomParameters", "GetParameter(Renovation.RenovationStatus)", renoStatus)

text2 0, 0, renoStatus

Cheers
Thx.
With my very tiny GDL skills I cad get the code to display reonvation status with the renoStatus parameter. How can I connect an IF THEN ELSE to use the status? IF renoStatus = "New" THEN....circle 0,0,1 ELSE IF...etc
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
Dominic Wyss
Booster
Yes. exactly like that


renoStatus = ""
_r = APPLICATION_QUERY ("OwnCustomParameters", "GetParameter(Renovation.RenovationStatus)", renoStatus)

if renoStatus = "New" then !! <- String is localized. So in your case it should be "Ny"
    !do something

else
    !some code

endif

Important: the returned string is localized. So in your case it should be "Ny"
AC27 CHE - macOS Ventura M1
Anonymous
Not applicable
Thanks Dominic! Much appreciated.
And thank you Mats for posting your question.
And I agree... It would be better if the parameter was a global integer.
Though I think the whole Renovation Status should be incorporated to the Properties.
And finally, introducing the Model Filter View Option.
Cheers,
Mats_Knutsson
Advisor
Dominic wrote:
Yes. exactly like that


renoStatus = ""
_r = APPLICATION_QUERY ("OwnCustomParameters", "GetParameter(Renovation.RenovationStatus)", renoStatus)

if renoStatus = "New" then !! <- String is localized. So in your case it should be "Ny"
    !do something

else
    !some code

endif

Important: the returned string is localized. So in your case it should be "Ny"
Many thanks Dominic!
I got it to work . Now I need to get the symbols from our landscapers and start coding.
Mats
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
Mats_Knutsson
Advisor
Braza wrote:
Thanks Dominic! Much appreciated.
And thank you Mats for posting your question.
And I agree... It would be better if the parameter was a global integer.
Though I think the whole Renovation Status should be incorporated to the Properties.
And finally, introducing the Model Filter View Option.
Cheers,
We strongly don't like the dubious interaction between Renovation filters, MVO and GO. Polish parliament kind of.
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.