> For the complete documentation index, see [llms.txt](https://manual.karamba3d.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.karamba3d.com/2-getting-started/2-getting-started-1/2.7-naming-and-selection-of-elements.md).

# 2.7 Naming and Selection of Elements

Attaching properties to elements, querrying element results or controlling partial model visibility via the ModelView-component depends on element identifiers (Ids). A nifty naming scheme makes it easier to manage complex models by grouping elements into logical parts and hierarchies.

## Definition of Element Names

Element names are assigned during creation using the **Create Linear Element** or **Create Surface Element** components. They can later be modified with the **ModifyElement** component.

Valid names must start with a letter and may include letters, numbers, or underscores (`_`). Pure numeric names are not allowed because each element already has a default name based on its index in the model. Another default name is the empty string `""`, which means that using `""` as a selection string will select all elements in the model.

<figure><img src="/files/fSsL9f566U6stevLgM6v" alt=""><figcaption><p>Fig 2.7.1: Hierarchical naming scheme for elements.</p></figcaption></figure>

#### Multiple Names

Elements can have multiple names (e.g., their index plus user-defined names). To assign multiple names, separate them with vertical bars:\
`name1|name2|name3`\
This attaches the names `name1`, `name2`, and `name3` to the element.

{% hint style="info" %}
Since element names needn't be unique multiple names on an elements may be used to categorize the latter: e.g. according to length ranges, cross section properties, joint-conditions,...\
These categories can then be conveniently visualized using a ModelView-component's "View"-input (see section [3.7.1.1 ModelView](/3-in-depth-component-reference/3.6-results/3.7.1-general-results/3.6.1-modelview.md)).
{% endhint %}

#### Hierarchical Naming Schemes

A hierarchical naming scheme can be created using dot notation:\
`Level1.Level2.Level3`\
Such an element can be selected using `Level1`, `Level1.Level2`, or `Level1.Level2.Level3`. This is equivalent to the shorthand:\
`Level1|Level1.Level2|Level1.Level2.Level3`.

Figure 2.7.1 shows a model with four beam elements where hierarchical naming was used to apply beam loads to different parts of the model.

## Selection of Elements by Name

When attaching loads, assigning cross sections, or controlling model visibility in Karamba3D, elements are typically referenced by their **name**. In some cases, you can also provide the element object directly, in which case its **GUID** is used during the model assembly process.

Element naming is case sensitive in Karamba3D.

**Element naming is case-sensitive** in Karamba3D. Each element has two default names:

* An empty string
* Its element index (which can be visualized in the *ModelView* component).\
  Element indexes correspond to the order in which elements were fed into the *AssembleModel* component.

You can reference elements by their IDs in three ways:

1. **Direct name**: Supply the full element name.
2. **Wildcard selection**: Use `*` or `&` in the selection string. For example, `abc*` selects all elements whose name starts with `abc` followed by any characters.
3. **Regular expressions**: Start with `&` and follow C# regex rules. For example, `&^abc\d{3}$` matches names starting with `abc` followed by exactly three digits.\
   If you’re new to regex, large language models can help you compose them.

For **shell and membrane elements**, the term “element” refers to patches of finite surface elements. Their internal order corresponds to the mesh face order of the original mesh. To reference a single finite element for display, append `/` and the index to the element name (e.g., `abc/0` refers to the first finite element within structure element `abc`).\
See the example file *OptiCroSec\_Shell\_Large.gh* for details.

## Selection of Elements via Component

There is the "Select Elements"-component for selecting elements based on their properties. For details see [here](/3-in-depth-component-reference/3.1-model/3.1.16-select-elements.md).

## Selection of Elements based on Geometry

The visibility of model elements can be controlled through the *“View”* input of the *ModelView* component. All previously described selection techniques are applicable here. In addition, geometric inputs such as Breps, planes, surfaces, and base lines can be used.

* **Breps:** Elements are displayed if their endpoints lie within the Brep.
* **Planes and Surfaces:** Elements are shown if they lie on the respective plane or surface.
* **Base lines:** These define vertical planes that are used to determine element visibility.

If multiple selection criteria are provided to the *“View”* input, an **OR condition** is applied, meaning an element is visible if it satisfies at least one of the given criteria.

{% file src="/files/xKG2sXfGk6ieeodpgynl" %}

{% file src="/files/bCIVdbr3quPWq3QJG3ns" %}
