n = APPLICATION_QUERY
(extension_name, parameter_string, variable1, variable2, ...)
Below is a list of request functions can provide with the help of the APPLICATION_QUERY command.
These request options are given in the extension_name
and the parameter_string
parameter of the command.
Note, that the query options and return values of an APPLICATION_QUERY may vary according to the execution context.
Compatibility up to ARCHICAD 19: the use of the listed application queries in parameter scripts (or master scripts run as parameter script) could result in unreliable returned values, and causes GDL warnings.
Compatibility starting from ARCHICAD 20: the listed queries cause warnings in parameter scripts, and the return value is either 0 or empty string, according to variable type.
The above restriction applies to:
- “document_feature”
This command can return features of the active document/view.
Currently there is only one feature it can return – the view direction of the document.
These type of queries are restricted from the parameter script and cause GDL warnings.
This command returns MEP system types and information about MEP systems.
It has more functions which can be addressed via the parameter_string
parameter:
DIM d[2][]
n =APPLICATION_QUERY
("MEPSYSTEM"
, "GetMEPSystems(domain)", d)
domain:
MEP classification index (DuctWork – 1, PipeWork – 2) (GDL defines the MEP classifications based on connector class)n =APPLICATION_QUERY
("MEPSYSTEM"
, "GetDomain(idx)", d)
d:
domains (integer)1:
DuctWork2:
PipeWork3:
Duct- and PipeWork4:
Cabling5:
DuctWork and Cabling6:
PipeWork and Cabling7:
DuctWork, PipeWork and Cabling
This command returns whether MEP modeler is active.
It has one function which can be addressed via the parameter_string
parameter:
This command returns the connection types and the styles of connection types.
It has two functions which can be addressed via the parameter_string
parameter:
This command returns the geometry of flexible segments.
It has four functions which can be addressed via the parameter_string
parameter:
n =APPLICATION_QUERY
("MEPFLEXIBLESEGMENT"
, "AddControlPoint(x; y; z)", r)
Provides a control point to the add-on.
AddControlPoint:
x:
X coordinate of the control pointy:
Y coordinate of the control pointz:
Z coordinate of the control pointn =APPLICATION_QUERY
("MEPFLEXIBLESEGMENT"
, "AddDirectionAndWidthVector(i; dx; dy; dz; wx; wy; wz)", r)
Provides the direction and side vectors of the ends of spline to add-on. It is called twice.
AddDirectionAndWidthVector:
i:
id of port (1: 0. port, 2: 1. port etc.)dx:
X component of direction vector of the portdy:
Y component of direction vector of the portdz:
Z component of direction vector of the portwx:
X component of side vector of the portwy:
Y component of side vector of the portwz:
Z component of side vector of the portDIM d[]
n =APPLICATION_QUERY
("MEPFLEXIBLESEGMENT"
, "EndSectioning(res)", d)
Getting of the result of sectioning.
d:
Array of values:[9*k-8]:
X position of k segment[9*k-7]:
Y position of k segment[9*k-6]:
Z position of k segment[9*k-5]:
X component of tangent vector of k segment[9*k-4]:
Y component of tangent vector of k segment[9*k-3]:
Z component of tangent vector of k segment[9*k-2]:
X component of normal vector k segment[9*k-1]:
Y component of normal vector k segment[9*k]:
Z component of normal vector k segment
This command returns the geometry of flexible segment.
It has four functions which can be addressed via the parameter_string
parameter:
n =APPLICATION_QUERY
("MEPBEND"
, "GetBendTypeNames()", d)
d:
Bend Type Names (examples of INT version)"Radius"
"Square Throat"
"Mitered"
"45° Throat with 45° Heel"
"45° Throat with 90° Heel"
"45° Throat with Radius Heel"
"Radius Throat with 90° Heel"
"Pleated"
"Stamped"
"Segmented"
"Segmented Standing Seam"
This command can return various conditions of the parameter script.
Currently there is only one feature it can return – the distinction of the first run.
n =APPLICATION_QUERY
("parameter_script"
, "firstoccasion_in_progress", isFirstRun)
This command returns whether the current run is the first run
or a consequence of a previous execution of the parameter script which changed some parameters.
This command has no additional parameters.
The distinction may be important when a part of the parameter script executes a triggered event
– e.g. it handles the pushing of a function button.
Core & IFC Properties
These commands return the folder names, parameter names and parameter values of Core & IFC properties on the “Classification and Properties” tabpage (ID and Categories, Renovation, IFC Properties). No data is returned from 3d script and the expression result is 0.
Compatibility: up to ARCHICAD 19 the tabpage was called “Tags and Categories”. It was renamed “Categories and Properties” in ARCHICAD 20 with adding user-defined properties. These queries don’t return user-defined properties.
The order of parameters is the same as on the tabpage.
There are two possible extension_names
in these commands:
- “OwnCustomParameters” returns parameters of the object
- “ParentCustomParameters” returns parameters of the object’s parent
Compatibility: in ARCHICAD 20 the data of the parent element (for labels) has been made available with REQUEST “Properties_Of_Parent” too. These queries return the properties corresponding to “COREPROPERTY” and “IFCPROPERTY” property types.
DIM folderNamesArray[] ! idString1, shortNameString1, longNameString1, ! ... ! idStringi, shortNameStringi, longNameStringi n = APPLICATION_QUERY (extension_name, "GetParameterFolderNames()", folderNamesArray)
Returns the folder names of core & IFC properties.
folderNamesArray:
String array which contains the foldernames of the propertiesn / 3:
Number of foldersDIM parNamesArray[] ! idString1, shortNameString1, longNameString1, ! ... ! idStringj, shortNameStringj, longNameStringj n = APPLICATION_QUERY (extension_name, "GetParameterNames(folderID)", parNamesArray)
Returns the names of core & IFC properties.
GetParameterNames:
folderID:
The ID string of the folder returned from “GetParameterFolderNames”.parNamesArray:
String array which contains the names of the propertiesn / 3:
Number of parametersn = APPLICATION_QUERY (extension_name, "GetParameter(parID)", parValue)
Returns the value of a core or IFC property.
GetParameter:
parID:
The ID string of the parameter returned from “GetParameterNames”.parValue:
String which contains the value of the propertyn:
1 if successful, 0 otherwiseDIM folderNamesArray[] n = APPLICATION_QUERY ("OwnCustomParameters", "GetParameterFolderNames()", folderNamesArray) for i = 1 to vardim1(folderNamesArray) step 3 DIM parNamesArray[] querystring = "GetParameterNames(" + folderNamesArray[i] + ")" 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[j] + ")" 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
This command can return various features of the library manager.
n =APPLICATION_QUERY
("LIBRARY_MANAGER"
, "IES_FILES", ies_files_list)
This command returns the list of file names with .ies extensions loaded with the active libraries.