Graphisoft®

Basic Library Version: 16

Appendix B - APPLICATION_QUERY options

Index

  1. DOCUMENT_FEATURE
    1. view_direction
  2. MEPSYSTEM
    1. GetMepSystems
    2. GetDomain
    3. GetContourPen
    4. GetFillPen
    5. GetBackgroundPen
    6. GetFillType
    7. GetCenterLineType
    8. GetCenterLinePen
    9. GetSystemMaterial
    10. GetInsulationMaterial
  3. MEPMODELER
    1. IsAvailable
  4. MEPCONNECTIONTYPE
    1. GetConnectionTypes
    2. GetConnectionTypeStyle
  5. MEPFLEXIBLESEGMENT
    1. StartSectioning
    2. AddControlPoint
    3. AddDirectionAndWidthVector
    4. EndSectioning
  6. MEPBEND
    1. GetBendTypeNames
  7. PARAMETER_SCRIPT
    1. firstoccasion_in_progress

The following are the options for the APPLICATION_QUERY GDL command if you're using ArchiCAD. So these options come into the extension_name parameter of the command. Note that the options and return values APPLICATION_QUERY vary according to the execution context.

APPLICATION_QUERY (extension_name, parameter_string, variable1, variable2, ...)

1. DOCUMENT_FEATURE

This command can return various features of the active document/view. Currently there is only one feature it can return - the view direction of the document.

"view_direction"

This command returns the viewing direction of the current document type in which the object is being visualized. This command has no additional parameters.

Usage

n = APPLICATION_QUERY ("document_feature", "view_direction", type)

Output

Returned type values:

"vertical_only"
for floor plan
"horizontal_only"
for section and elevation generated from 3D (not when the object is placed into a S/E)
"free"
for 3D and 3D document
"none"
"unset"

2. MEPSYSTEM

This command return MEP systems and information about MEP systems. It has more functions which can be addressed via the parameter_string parameter:

"GetMepSystems"

Usage

DIM d[2][]
n = APPLICATION_QUERY ("MEPSYSTEM", "GetMEPSystems(domain)", d)

Input

"GetMEPSystems(domain)"

domain
MEP classification index (DuctWork – 1, PipeWork – 2) (The GDL defines the MEP classifications based on connector class)

Output

Array of values.

[2*k-1]
MEP system index
[2*k]
MEP system name

Return value

Number of MEP systems multiplied by 2.

"GetDomain"

Usage

n = APPLICATION_QUERY ("MEPSYSTEM", "GetDomain(idx)", d)

Input

"GetDomain(idx)"

idx
MEP system index

Output

d (integer)
domains
d = 1
DuctWork
d = 2
PipeWork
d = 3
Duct- and PipeWork
d = 4
Cabling
d = 5
DuctWork and Cabling
d = 6
PipeWork and Cabling
d = 7
DuctWork, PipeWork and Cabling

Return value

1 if successful, otherwise 0

"GetContourPen"

Usage

n = APPLICATION_QUERY ("MEPSYSTEM", "GetContourPen(idx)", pen)

Input

"GetContourPen(idx)"

idx
MEP system index

Output

pen (integer)
contour pen index

Return value

1 if successful, otherwise 0

"GetFillPen"

Usage

n = APPLICATION_QUERY ("MEPSYSTEM", "GetFillPen(idx)", pen)

Input

"GetFillPen(idx)"

idx
MEP system index

Output

pen (integer)
fill pen index

Return value

1 if successful, otherwise 0

"GetBackgroundPen"

Usage

n = APPLICATION_QUERY ("MEPSYSTEM", "GetBackgroundPen(idx)", pen)

Input

"GetBackgroundPen(idx)"

idx
MEP system index

Output

pen (integer)
background pen index

Return value

1 if successful, otherwise 0

"GetFillType"

Usage

n = APPLICATION_QUERY ("MEPSYSTEM", "GetFillType(idx)", filltype)

Input

"GetFillType(idx)"

idx
MEP system index

Output

filltype (integer)
fill type index

Return value

1 if successful, otherwise 0

"GetCenterLineType"

Usage

n = APPLICATION_QUERY ("MEPSYSTEM", "GetCenterLineType(idx)", line)

Input

"GetCenterLineType(idx)"

idx
MEP system index

Output

line (integer)
center line type index

Return value

1 if successful, otherwise 0

"GetCenterLinePen"

Usage

n = APPLICATION_QUERY ("MEPSYSTEM", "GetCenterLinePen(idx)", pen)

Input

"GetCenterLinePen(idx)"

idx
MEP system index

Output

pen (integer)
center line pen index

Return value

1 if successful, otherwise 0

"GetSystemMaterial"

Usage

n = APPLICATION_QUERY ("MEPSYSTEM", "GetSystemMaterial(idx)", material)

Input

"GetSystemMaterial(idx)"

idx
MEP system index

Output

material (integer)
system material index

Return value

1 if successful, otherwise 0

"GetInsulationMaterial"

Usage

n = APPLICATION_QUERY ("MEPSYSTEM", "GetInsulationMaterial(idx)", material)

Input

"GetInsulationMaterial(idx)"

idx
MEP system index

Output

material (integer)
insulation material index

Return value

1 if successful, otherwise 0

3. MEPMODELER

This command returns whether MEP modeler is active. It has one function which can be addressed via the parameter_string parameter:

"IsAvailable"

Usage

n = APPLICATION_QUERY ("MEPMODELER", "IsAvailable()", isavailable)

Input

"IsAvailable"

Output

isavailable (integer)
MEP Modeler is present

Return value

1 if successful, otherwise 0

4. MEPCONNECTIONTYPE

This command returns the connection types and styles of connection types. It has two functions which can be addressed via the parameter_string parameter:

"GetConnectionTypes"

Usage

DIM d[2][]
n = APPLICATION_QUERY ("MEPCONNECTIONTYPE", "GetConnectionTypes(connectorClass)", d)

Input

"GetConnectionTypes(connectorClass)"

connectorClass
connector class (Duct – 1, Pipe – 2, Cable carrier – 3)

Output

Array of values.

[2*k-1]
connection type guid
[2*k]
connection type name

Return value

Number of connection types multiplied by 2.

"GetConnectionTypeStyle"

Usage

DIM d[]
n = APPLICATION_QUERY ("MEPCONNECTIONTYPE", "GetConnectionTypeStyle(connectorClass)", d)

Input

"GetConnectionTypeStyle(connectorClass)"

connectorClass
connector class (Duct – 1, Pipe – 2, Cable carrier – 3)

Output

Array of values.

[]
connection type styles

Return value

Number of connection styles.

5. MEPFLEXIBLESEGMENT

This command returns the geometry of flexible segment. It has four functions which can be addressed via the parameter_string parameter:

"StartSectioning"

Indicates that sectioning has begun.

Usage

n = APPLICATION_QUERY ("MEPFLEXIBLESEGMENT", "StartSectioning()", r)

Input

Output

r
not used

Return value

1 if successful, otherwise 0

"AddControlPoint"

Giving of the control point to add-on. It is called number of control points

Usage

n = APPLICATION_QUERY ("MEPFLEXIBLESEGMENT", "AddControlPoint(x; y; z)", r)

Input

"AddControlPoint(x; y; z)"

x
x coordinate of the control point
y
y coordinate of the control point
z
z coordinate of the control point

Output

r
not used

Return value

1 if successful, otherwise 0

"AddDirectionAndWidthVector"

Giving of the direction and side vectors of the ends of spline to add-on. It is called twice.

Usage

n = APPLICATION_QUERY ("MEPFLEXIBLESEGMENT", "AddDirectionAndWidthVector(i; dx; dy; dz; wx; wy; wz)", r)

Input

"AddDirectionAndWidthVector(i; dx; dy; dz; wx; wy; wz)"

i
id of port (1: 0. port, 2: 1. port etc.)
dx
x component of direction vector of the port
dy
y component of direction vector of the port
dz
z component of direction vector of the port
wx
x component of side vector of the port
wy
y component of side vector of the port
wz
z component of side vector of the port

Output

r
not used

Return value

1 if successful, otherwise 0

"EndSectioning"

Getting of the result of sectioning.

Usage

DIM d[]
n = APPLICATION_QUERY ("MEPFLEXIBLESEGMENT", "EndSectioning(res)", d)

Input

"EndSectioning(res)"

res
resolution of sectioning

Output

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 of k segment
[9*k-1]
y component of normal vector of k segment
[9*k]
z component of normal vector of k segment

Return value

Number of segments.

6. MEPBEND

This command returns the bend type names. It has one function which can be addressed via the parameter_string parameter:

"GetBendTypeNames"

Usage

DIM d[]
n = APPLICATION_QUERY ("MEPBEND", "GetBendTypeNames()", d)

Input

"GetBendTypeNames()"

Output

bend type names

example 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"

Return value

1 if successful, otherwise 0

7. PARAMETER_SCRIPT

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.

"firstoccasion_in_progress"

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.

Usage

n = APPLICATION_QUERY ("parameter_script", "firstoccasion_in_progress", isFirstRun)

Output

The returned value shows whether the current run is the first run.