Skip to content

Base Element Adapter

Class full path: NemAll_Python_IFW_ElementAdapter.BaseElementAdapter

Implementation of the base element adapter

BaseElementAdapter is used inside the IFW as general element class, e.g. as result of an element selection. The class is created as adapter to avoid future IFW changes if the internal CAD data structure will be changed.

The class has some member functions to get the general element data like name, geometry, common properties, ...

The adapter includes also the DocumentAdapter, which can be used to get the access to the internal CAD data structure.

Functions

FromGUID(guid, doc) staticmethod

Get elements from GUID

Parameters:

Name Type Description Default
guid GUID

GUID of the element

required
doc DocumentAdapter

Document

required

Returns:

Type Description
BaseElementAdapter

Document

FromNOIGUID(guidstr, doc) staticmethod

Get elements from NOI GUID

Parameters:

Name Type Description Default
guidstr str

NOI-GUID string of the element

required
doc DocumentAdapter

Document

required

Returns:

Type Description
BaseElementAdapter

Document

GetArchElementType()

Check the type of an architectural element (PRGBER_ELEM_ARCH)

Returns:

Type Description
ArchElementType

type of the architectural element

GetAttributes(readState)

Get the attributes

Parameters:

Name Type Description Default
readState eAttibuteReadState

Attribute read state

required

Returns:

Type Description
List[Tuple[int, Union[int, float, str]]]

List with Attributes as tuples (AttributeID, ArttibuteValue)

GetCommonProperties()

Get the common properties of the element

Returns:

Type Description
CommonProperties

Common properties of the element

GetDisplayName()

Get the display name of the element. The same name, which is shown in the Element info box, when point on the element with a mouse on the model view. Note, that the display name changes depending on the language used!

Returns:

Type Description
str

Display name of the element

GetDocument()

Get the document adapter

Returns:

Type Description
DocumentAdapter

Document adapter

GetDrawingfileNumber()

Get the drawing file number of the element

Returns:

Type Description
int

Drawing file number of the element / negative means drawing is in passive mode

GetElementAdapterType()

Get the type of the element

Returns:

Type Description
ElementAdapterType

Type ID of the element

GetElementUUID()

Get the UUID of the element

Returns:

Type Description
GUID

UUID of the element

GetGeometry()

Get elements geometry.

Note, that this method,when called on an adapter of an architectural element, returns different results depending on the view:

  • in ground view: returns a 2D geometry, just as GetGroundViewArchitectureElementGeometry()
  • in isometric view: returns a 3D geometry, just as GetModelGeometry()

Returns:

Type Description
Any

Geometry object represented by an instance of a class from the NemAll_Python_Geometry module

GetGroundViewArchitectureElementGeometry()

Get ground view geometry of an architecture element (if exist)

Returns:

Type Description
Any

Geometry object represented by an instance of a class from the NemAll_Python_Geometry module

GetModelElementUUID()

Get the UUID of the model element

Returns:

Type Description
GUID

UUID of the element

GetModelGeometry()

Get element model geometry

Returns:

Type Description
Any

Geometry object represented by an instance of a class from the NemAll_Python_Geometry module

GetParentElementAdapterType()

Get the type of the parent element

Returns:

Type Description
ElementAdapterType

Type ID of the parent element

GetPureArchitectureElementGeometry()

Get the pure geometry of an architecture element (if exist). The geometry is without openings, ...

Returns:

Type Description
Any

Geometry

GetTimeStamp()

Get the time stamp of the element

Returns:

Type Description
int

Time stamp of the element creation

Is3DElement()

Get the 3D state of the element

Returns:

Type Description
bool

Element is a 3D element: true/false

IsActive()

Get the activation state of the element

Returns:

Type Description
bool

True, if the element is activated

IsChildParentType(childType, parentType)

Check for child (current element) and parent type connection

Parameters:

Name Type Description Default
childType GUID

Type of the element

required
parentType GUID

Type of the parent element

required

Returns:

Type Description
bool

True when child (current object) has a parent of given type

IsDeleted()

Get the deleted state of the element

Returns:

Type Description
bool

True, if the element is deleted

IsGeneralElement()

Check if element is general (PRGBER_ELEM_ALLG)

General element is ex. a line or a 3D solid. General element is NOT a wall, column, etc.

Returns:

Type Description
bool

Element is general (PRGBER_ELEM_ALLG)

IsInActiveDocument()

If element is in active document return true.

Returns:

Type Description
bool

true if element is in active document

IsInActiveLayer()

If element is in active layer return true.

Returns:

Type Description
bool

true if element is in active layer.

IsInMacro()

Check if element has parent object of any type (ex. is part of MacroGroup or ElementGroup)

Returns:

Type Description
bool

Element has parent

IsLabelElement()

Check if element is a part of some label (Variables Textbild)

Returns:

Type Description
bool

Element is a part of some label: true/false

IsNull()

Check for an empty element

Returns:

Type Description
bool

Element is empty: true/false

IsValidForSelectFace()

Check if element is valid for face select

Returns:

Type Description
bool

Element is valid for face select

SetVisibilityState(visible)

Set the visibility state of the element

Parameters:

Name Type Description Default
visible bool

She visibility state to set

required

__eq__ overload

__eq__(element)

Equal operator

Parameters:

Name Type Description Default
element BaseElementAdapter

Element to compare

required

Returns:

Type Description
bool

Elements are equal: true/false

__eq__(eleTypeUUID)

Equal operator for checking the element adapter type UUID

Parameters:

Name Type Description Default
eleTypeUUID GUID

Element type UUID

required

__init__ overload

__init__()

initialize

__init__(element)

Copy constructor

Parameters:

Name Type Description Default
element BaseElementAdapter

Element

required

__ne__ overload

__ne__(eleType)

Not equal operator for checking the element type

Parameters:

Name Type Description Default
eleType BaseElementAdapter

Element type

required
__ne__(eleType)

Not equal operator for checking the element type

Parameters:

Name Type Description Default
eleType GUID

Element type

required

__repr__()

Convert to string