# Queries

Query points: In the composite element, queries for points can be defined. When the composite element is inserted, the user is then prompted to select the corresponding points graphically. The predefined text is used for this purpose.

* The coordinates of these points can then be used in the composite element for formulas and for positioning. The points are automatically named according to their order as P1, P2, P3, etc. The X coordinate of the first point is available as system variable P1X.

Query bodies: In the composite element, queries for bodies can be defined. When the composite element is inserted, the user is then prompted to select the corresponding bodies graphically.

* The query bodies are automatically numbered as K1, K2, K3, etc.
* The coordinates of the corner points and axis points of the body can be used for formulas and for positioning. The X coordinate of the start of the axis of the first query body is available as system variable K1E4X. For further explanation, see the help images in the formula editor.
* The dimensions of the body can also be used in formulas. The cross-section width of the first query body is available as system variable K1B. For further explanation, see the help images in the formula editor.
* The identification number of the body can also be transferred to library elements or used in texts.
* The point symbols can be applied to the query bodies.

Query bodies: System variable for the selected component end:

The execution of a composite element can depend on which component end (start or end) is affected. For this purpose, the user can be prompted to select the component at the desired component end. It is sufficient to click anywhere on the corresponding half of the component. The system variable KnAAE is then evaluated in the composite element: it has the value -1 if the component was selected at the start and 1 if it was selected at the end. If the user has selected the third query body at the start, then K3AAE=-1.

Composite elements: Flexible number of query points and query bodies

When a composite element is used, it is no longer necessary to select all defined query points and query bodies. If a composite element has up to 8 query points, for example, the selection can be ended after selecting the third point by right-clicking the mouse, and the composite element will be executed. Since older composite elements cannot handle a reduced number of query points or query bodies, they will still be terminated if not all have been selected.

It is also possible to cancel the composite element if it is rejected with MR already at the first query point or first query body.

The composite element must be structured so that query points not selected and query bodies not selected do not cause any problems. Appropriate conditions must be set.

* A query point was not selected if its coordinates have the value 999999. For example, P3X=999999.0
* A query body was not selected if its length has the value 0.0, for example, K3L=0.00

Composite elements - Automatically searched query bodies

Information such as identification number or dimensions is often required from query bodies. Query bodies can be selected by the user or automatically searched via a reference point.

* Below the list of query bodies are parameters of the currently selected query body. In the *Definition of the query body* it can be selected whether the query body should be selected by the user or searched by the program via a reference point.
* The reference point required, if applicable, is defined in the next 3 fields.
  * It should be noted here that the coordinates must generally be specified in the base coordinate system. However, if in the insertion for the positioning point *selection* or *direct insertion point* is used, the coordinate system is determined by the selected insertion point and the coordinates must accordingly be specified in it.
  * Intermediate values can be used to calculate the coordinates. See also intermediate values when calculating coordinates for insertion coordinate systems.
* If the reference point touches a component, it is selected as a query body. Its information can then be accessed like that of a normal query body. When searching with the reference point, wall bodies, ceiling layer slabs, and roof layer slabs are ignored.
* An automatically searched query body can be combined with selected query bodies. It retains its number even if not all preceding query bodies were selected.
  * There is the option to cancel a composite element with the right mouse button at the first query body (see above: *Flexible number of query points and query bodies*). Therefore, when mixing selected and automatically searched query bodies, the first query body should be a selected one.
* (19.03) An automatically searched query body retains its number even if not all preceding automatically searched query bodies were found.

Query bodies can now also be assigned to the assembly. For example, if you select an existing steel beam to attach an end plate with a composite element, they can form an assembly together.

* For this purpose, in the setting *Add query bodies to assembly* the 2nd option *Yes* is selected.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dietrichs.com/dietrichs-intelligent-documentation/docs-de-en/combined-elements/create-edit-combined-elements/queries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
