ifcopenshell.api.material.edit_profile
¶
Module Contents¶
- ifcopenshell.api.material.edit_profile.edit_profile(file: ifcopenshell.file, profile: ifcopenshell.entity_instance, attributes: dict[str, Any] | None = None, profile_def: ifcopenshell.entity_instance | None = None, material: ifcopenshell.entity_instance | None = None) None ¶
Edits the attributes of an IfcMaterialProfile
For more information about the attributes and data types of an IfcMaterialProfile, consult the IFC documentation.
- Parameters:
profile (ifcopenshell.entity_instance) – The IfcMaterialProfile entity you want to edit
attributes (dict, optional) – a dictionary of attribute names and values.
profile_def (ifcopenshell.entity_instance, optional) – The IfcProfileDef entity the profile curve should be extruded from.
material (ifcopenshell.entity_instance, optional) – The IfcMaterial entity you want to change the profile to be made from.
- Returns:
None
- Return type:
None
Example:
# Let's create a material set to store our profiles. material_set = ifcopenshell.api.material.add_profile_set(model, name="B1", set_type="IfcMaterialProfileSet") # Create a couple steel materials. steel1 = ifcopenshell.api.material.add_material(model, name="ST01", category="steel") steel2 = ifcopenshell.api.material.add_material(model, name="ST01", category="steel") # Create some I-shaped profiles. Notice how we name our profiles based # on standardised steel profile names. hea100 = file.create_entity( "IfcIShapeProfileDef", ProfileName="HEA100", ProfileType="AREA", OverallWidth=100, OverallDepth=96, WebThickness=5, FlangeThickness=8, FilletRadius=12, ) hea200 = file.create_entity( "IfcIShapeProfileDef", ProfileName="HEA200", ProfileType="AREA", OverallWidth=200, OverallDepth=190, WebThickness=6.5, FlangeThickness=10, FilletRadius=18, ) # Define that steel material and cross section as a single profile # item. If this were a composite beam, we might add multiple profile # items instead, but this is rarely the case in most construction. profile_item = ifcopenshell.api.material.add_profile(model, profile_set=material_set, material=steel1, profile=hea100) # Edit our profile item to use a HEA200 profile instead made out of # another type of steel. ifcopenshell.api.material.edit_profile(model, profile=profile_item, profile_def=hea200, material=steel2)