ModelReader#

class ansys.sam.sysml2.tools.model_reader.ModelReader#

Read metamodel elements with a single snake_case property vocabulary.

Overview#

get_inherited_element_class

Return the class used to wrap an inherited element under a parent part.

get

Read a field of element by its snake_case property name.

unwrap

Return the real element, without the wrapper that ties it to a parent part.

is_a

Tell whether element is a base (a Feature, a Type, a Namespace…).

is_chaining

Tell whether element reaches its target through a chain of features.

redefined_features

Return every feature that feature redefines, directly or indirectly.

Import detail#

from ansys.sam.sysml2.tools.model_reader import ModelReader

Method detail#

ModelReader.get_inherited_element_class()#

Return the class used to wrap an inherited element under a parent part.

ModelReader.get(element, key, default=None)#

Read a field of element by its snake_case property name.

ModelReader.unwrap(element)#

Return the real element, without the wrapper that ties it to a parent part.

ModelReader.is_a(element, base)#

Tell whether element is a base (a Feature, a Type, a Namespace…).

ModelReader.is_chaining(element)#

Tell whether element reaches its target through a chain of features.

ModelReader.redefined_features(feature)#

Return every feature that feature redefines, directly or indirectly.