# Member Attributes functions | OpenStaad Python

> User-defined attributes and metadata attached to members for tagging and downstream workflows.

Source: https://www.openstaad.com/docs/member-attributes

Every function is a method of the session `s = ops.connect()` (`from openstaad import ops`).

## Create

### CreateMemberAttribute

**Description**

Creates the member attribute.

**Parameters**

- `attribute_name` (str): attribute name.
- `str_Value` (str): str value.

**Returns**

bool: `True` if the call succeeded, `False` otherwise.

**Example**

```python
from openstaad import ops

s = ops.connect()
result = s.CreateMemberAttribute("value", "value")
print(result)
```

## Get

### GetMemberAttributeCount

**Description**

Returns the member attribute count.

**Parameters**

None.

**Returns**

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

**Example**

```python
from openstaad import ops

s = ops.connect()
result = s.GetMemberAttributeCount()
print(result)
```

### GetMemberAttributeList

**Description**

Returns the member attribute list.

**Parameters**

None.

**Returns**

tuple: A tuple of `(list[str], list[str], raw)`.

**Example**

```python
from openstaad import ops

s = ops.connect()
result = s.GetMemberAttributeList()
print(result)
```

### GetMemberCountByAttribute

**Description**

Returns the member count by attribute.

**Parameters**

- `attribute_name` (str): attribute name.
- `str_Value` (str): str value.

**Returns**

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

**Example**

```python
from openstaad import ops

s = ops.connect()
result = s.GetMemberCountByAttribute("value", "value")
print(result)
```

### GetMemberCountByAttributeIndex

**Description**

Returns the member count by attribute index.

**Parameters**

- `index` (int): index.

**Returns**

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

**Example**

```python
from openstaad import ops

s = ops.connect()
result = s.GetMemberCountByAttributeIndex(1)
print(result)
```

### GetMemberListByAttribute

**Description**

Returns the member list by attribute.

**Parameters**

- `attribute_name` (str): attribute name.
- `str_Value` (str): str value.

**Returns**

list: A list of integers.

**Example**

```python
from openstaad import ops

s = ops.connect()
result = s.GetMemberListByAttribute("value", "value")
print(result)
```

### GetMemberListByAttributeIndex

**Description**

Returns the member list by attribute index.

**Parameters**

- `index` (int): index.

**Returns**

list: A list of integers.

**Example**

```python
from openstaad import ops

s = ops.connect()
result = s.GetMemberListByAttributeIndex(1)
print(result)
```

## Set/Assign

### AssignMemberAttribute

**Description**

Assigns the member attribute.

**Parameters**

- `attribute_name` (str): attribute name.
- `str_Value` (str): str value.
- `member_list` (bool): member list.

**Returns**

bool: `True` if the call succeeded, `False` otherwise.

**Example**

```python
from openstaad import ops

s = ops.connect()
result = s.AssignMemberAttribute("value", "value", True)
print(result)
```

## Delete

### DeleteMemberAttribute

**Description**

Deletes the member attribute.

**Parameters**

- `attribute_name` (str): attribute name.
- `str_Value` (str): str value.

**Returns**

bool: `True` if the call succeeded, `False` otherwise.

**Example**

```python
from openstaad import ops

s = ops.connect()
result = s.DeleteMemberAttribute("value", "value")
print(result)
```
