Skip to main content
Version: 2026R2

Sensor

class compolyx.Sensor(graph, obj, parent=None)

Sensor object for meassuring areas, prices, weights, and centers of gravity.

Attributes

NameDescription
Sensor.activeWhether the sensor is computed on update or not
Sensor.areaArea covered by all Entities of the Sensor
Sensor.center_of_gravityCenter of Gravity over all Entities of the Sensor
Sensor.enabledWhether this object is currently enabled or not
Sensor.entitiesEntities of the Sensor
Sensor.idID of object
Sensor.is_dict_itemSpecifies whether the object is an item of a dict
Sensor.is_list_itemSpecifies whether the object is an item of a list
Sensor.link_pathRoot path of the current node in the tree for links to this object
Sensor.lockedSensor cut was imported and cannot be changed.
Sensor.modeling_ply_areaCumulated area of all modeling-plies involved
Sensor.nameName of object
Sensor.parentParent object in tree
Sensor.pricePrice over all Entities of the Sensor
Sensor.production_ply_areaCumulated area of all production-plies involved
Sensor.root_pathRoot path of the current node in the tree
Sensor.sensor_typeSensor type.
Sensor.statusStatus of the object
Sensor.status_changedBoolean flag which is set to true in C++ when up-to-date status of object changes
Sensor.uidUID of object
Sensor.vertexThis will throw an error if the object has been removed from the graph
Sensor.weightWeight over all Entities of the Sensor

Methods

NameDescription
Sensor.add_entity(entity)Add entity to sensor
Sensor.clear_entities()Clear all entities of this sensor
Sensor.find_parent(type)Function steps up the tree and returns the first parent with given type
Sensor.obj_exists()Checks if __obj still references the c++ object (i.e. has not been reset to None by self._delete) AND exists in the graph
Sensor.remove_entity(entity)Remove entity from sensor.
Sensor.serialize()
Sensor.serialize_name_and_id()Helper function to serialize name and ID
Sensor.update()
Sensor.visit(visitor)Walk through the tree and let the visitor perform action on every descendant node