Named (hwx.inspire)#

class Named#

Bases: object

Base class for all data model objects except Features.

Attribute Table#

Name

Type

active

Bool

history

History

model

Model

name

String

namespace

str

parent

property

units

UnitsManager

visible

Bool

Method Table#

Name

Description

destroy (self)

Delete the object removing it from the model.

getAllChildren (self, type=None, **kwds)

Returns a list of all children that matches the specified type.

getChild (self, name=None, recursive=False, **kwds)

Returns the child of the object which matches the specified unique name.

getChildren (self, type=None, recursive=False, sorted=False, **kwds)

Returns a list of children that is of the specified type.

getClass (className)

Returns the class of the object.

getDependents (self, recursive=False, **kwds)

Get objects that reference this object through a Reference attribute.

getReferences (self, recursive=False, **kwds)

Get objects this object references through a Reference attribute.

isa (self, type=None, filter=None, name=None, wildcard=None, **kwds)

Determines if the object matches the specified settings or not.

modelPositions (self)

Forces all objects to return the original model positions instead of the

property name#

Returns or sets the name of the object.

It can be any text string, including spaces, although it’s best to avoid using the following characters: “ ‘ * ? and $.

While these characters are allowed, they could create difficulties when you export the model to other applications.

property visible#

Determines whether the object is visible in the graphics window.

Setting this on or off sets all children. Setting to True sets all the parents visible too.

property active#

Returns or sets the object activeness.

Setting this on or off sets all children. Setting to True sets all the parents active too.

property parent#

Returns the parent of this entity.

Type:

Assembly

getChildren(type=None, recursive=False, sorted=False, **kwds)#

Returns a list of children that is of the specified type.

Parameters:
  • type (Type[Named]) – Filter objects by class.

  • recursive (bool) – True to get all descendent Parts and Assemblies.

  • sorted (bool) – Sort the children base on id.

Returns:

list[Named]

getAllChildren(type=None, **kwds)#

Returns a list of all children that matches the specified type.

Parameters:
  • type (list[Named]) – Filter to use to get the children based on object type.

  • **kwds – Additional keyword arguments to match other attributes of the object.

Returns:

The list of children that satisfy the supplied filters.

Return type:

list[Union[Part, Motor, BoundaryCondition, …]]

getChild(name=None, recursive=False, **kwds)#

Returns the child of the object which matches the specified unique name.

Parameters:
  • name (str) – The name of the child object.

  • recursive (bool) – Search all descendents.

  • **kwds – Additional keyword arguments to match attributes of the object.

Returns:

The child object which satisfies the specified filters.

Return type:

Named

getReferences(recursive=False, **kwds)#

Get objects this object references through a Reference attribute.

Parameters:
  • recursive (bool) –

  • **kwds – Filter objects using isa.

Returns:

set[Named]

getDependents(recursive=False, **kwds)#

Get objects that reference this object through a Reference attribute.

Parameters:
  • recursive (bool) –

  • **kwds – Filter objects using isa.

Returns:

set[Named]

isa(type=None, filter=None, name=None, wildcard=None, **kwds)#

Determines if the object matches the specified settings or not.

Parameters:
  • type (Union[Part, Assembly, Contact..]) – The type of the object.

  • filter (method) – Return value of specified callback method.

  • name (str) – Name that matches exactly with object name.

  • wildcard (str) – A pattern to match exactly with the object name.

  • **kwds – Additional keyword arguments to match other attributes.

Returns:

True, if a match is found, otherwise False.

Return type:

bool

destroy()#

Delete the object removing it from the model.

The object may come back due to an undo/redo.

modelPositions()#

Forces all objects to return the original model positions instead of the current analysis positions.

Useful when defining draw methods on GeneralObjects where behaviour is different while animating.