KeyValueCollection#

class ansys.stk.core.stkobjects.KeyValueCollection#

A collection of keys and values associated with the keys.

Overview#

item

Given a key, returns associated element.

contains

Determine whether the collection contains the specified key.

remove_all

Remove all elements.

remove_key

Remove an element associated with specified key.

set

Set the value associated with specified key.

get_read_only

Given a key, returns read-only flag.

set_read_only

Given a key, sets read-only flag.

count

Return the number of elements in a collection.

_new_enum

Return an enumerator containing the keys in the collection.

keys

Return an array of keys of the collection.

Import detail#

from ansys.stk.core.stkobjects import KeyValueCollection

Property detail#

property KeyValueCollection.count: int#

Return the number of elements in a collection.

property KeyValueCollection._new_enum: EnumeratorProxy#

Return an enumerator containing the keys in the collection.

property KeyValueCollection.keys: list#

Return an array of keys of the collection.

Method detail#

KeyValueCollection.item(self, key: str) str#

Given a key, returns associated element.

Parameters:

key : str

Returns:

str

KeyValueCollection.contains(self, key: str) bool#

Determine whether the collection contains the specified key.

Parameters:

key : str

Returns:

bool

KeyValueCollection.remove_all(self) None#

Remove all elements.

Returns:

None

KeyValueCollection.remove_key(self, key: str) bool#

Remove an element associated with specified key.

Parameters:

key : str

Returns:

bool

KeyValueCollection.set(self, key: str, value: str) None#

Set the value associated with specified key.

Parameters:

key : str

value : str

Returns:

None

KeyValueCollection.get_read_only(self, key: str) bool#

Given a key, returns read-only flag.

Parameters:

key : str

Returns:

bool

KeyValueCollection.set_read_only(self, key: str, is_read_only: bool) None#

Given a key, sets read-only flag.

Parameters:

key : str

is_read_only : bool

Returns:

None