ifcopenshell.api.attribute
¶
Basic modification of the attributes of an element.
All IFC entities have attributes. Some of these attributes contain rules about inheritance and what they are allowed to contain. These usecases make sure that any editing complies with these rules.
Submodules¶
Package Contents¶
- ifcopenshell.api.attribute.edit_attributes(file: ifcopenshell.file, product: ifcopenshell.entity_instance, attributes: dict[str, Any]) None ¶
Edit the attributes of a product
All IFC entities have attributes. Normally they can be edited directly, by simply assigning a new value to them. In some scenarios, you may wish to also ensure that ownership history is updated. This function provides that convenience.
- Parameters:
product (ifcopenshell.entity_instance) – The product you want to edit. This may be any rooted IFC entity.
attributes (dict) – a dictionary of attribute names and values.
- Returns:
None
- Return type:
None
Example:
element = ifcopenshell.api.root.create_entity(model, ifc_class="IfcWall") ifcopenshell.api.attribute.edit_attributes(model, product=element, attributes={"Name": "Waldo"})