# 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>

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 %}

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 via Names

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.

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

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


---

# 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://manual.karamba3d.com/2-getting-started/2-getting-started-1/2.7-naming-and-selection-of-elements.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.
