ifcopenshell.api.root.copy_class

Module Contents

class ifcopenshell.api.root.copy_class.Usecase
copy_direct_attributes(to_element)
copy_indirect_attributes(from_element, to_element)
copy_object_placements(element)
copy_psets(element)
execute()
remove_representations(element)
ifcopenshell.api.root.copy_class.copy_class(file: ifcopenshell.file, product: ifcopenshell.entity_instance) ifcopenshell.entity_instance

Copies a product

The following relationships are also duplicated:

  • The copy will have the same object placement coordinates as the original.

  • The copy will have duplicated property sets, properties, and quantities

  • The copy will have all nested distribution ports copied too

  • The copy will be part of the same aggregate

  • The copy will be contained in the same spatial structure

  • The copy, if it is an occurrence, will have the same type

  • Voids are duplicated too

  • The copy will have the same material as the original. Parametric material set usages will be copied.

  • The copy will be part of the same groups as the original.

Be warned that:

  • Representations are _not_ copied. Copying representations is an expensive operation so for now the user is responsible for handling representations.

  • Filled voids are not copied, as there is no guarantee that the filling will also be copied.

  • Path connectivity is not copied, as there is no guarantee that the connections are still valid.

Parameters:

product – The IfcProduct to copy.

Returns:

The copied product

Return type:

ifcopenshell.entity_instance

Example:

# We have a wall
wall = ifcopenshell.api.root.create_entity(model, ifc_class="IfcWall")

# And now we have two
wall_copy = ifcopenshell.api.root.copy_class(model, product=wall)