docs fixes

1) material.add_profile_set doesn't exist
2) usecase.file is not defined, use `model` instead`
3) Specify material for material.assign_material
This commit is contained in:
Andrej730
2025-03-03 13:23:49 +05:00
parent fed063a0c6
commit 7f27785927
5 changed files with 9 additions and 9 deletions
@@ -67,7 +67,7 @@ def add_profile(
# First, let's create a material set. This will later be assigned
# to our beam type element.
material_set = ifcopenshell.api.material.add_profile_set(model,
material_set = ifcopenshell.api.material.add_material_set(model,
name="B1", set_type="IfcMaterialProfileSet")
# Create a steel material.
@@ -48,7 +48,7 @@ def assign_profile(
# First, let's create a material set. This will later be assigned
# to our beam type element.
material_set = ifcopenshell.api.material.add_profile_set(model,
material_set = ifcopenshell.api.material.add_material_set(model,
name="B1", set_type="IfcMaterialProfileSet")
# Create a steel material.
@@ -56,7 +56,7 @@ def assign_profile(
# Create an I-beam profile curve. Notice how we name our profiles
# based on standardised steel profile names.
hea100 = usecase.file.create_entity(
hea100 = model.create_entity(
"IfcIShapeProfileDef", ProfileName="HEA100", ProfileType="AREA",
OverallWidth=100, OverallDepth=96, WebThickness=5, FlangeThickness=8, FilletRadius=12,
)
@@ -84,7 +84,7 @@ def assign_profile(
# Now let's change the profile to a HEA200 standard profile instead.
# This will automatically change the body representation that we
# just added as well to a HEA200 profile.
hea200 = usecase.file.create_entity(
hea200 = model.create_entity(
"IfcIShapeProfileDef", ProfileName="HEA200", ProfileType="AREA",
OverallWidth=200, OverallDepth=190, WebThickness=6.5, FlangeThickness=10, FilletRadius=18,
)
@@ -46,7 +46,7 @@ def edit_profile(
.. code:: python
# Let's create a material set to store our profiles.
material_set = ifcopenshell.api.material.add_profile_set(model,
material_set = ifcopenshell.api.material.add_material_set(model,
name="B1", set_type="IfcMaterialProfileSet")
# Create a couple steel materials.
@@ -50,7 +50,7 @@ def edit_profile_usage(
# First, let's create a material set. This will later be assigned
# to our beam type element.
material_set = ifcopenshell.api.material.add_profile_set(model,
material_set = ifcopenshell.api.material.add_material_set(model,
name="B1", set_type="IfcMaterialProfileSet")
# Create a steel material.
@@ -58,7 +58,7 @@ def edit_profile_usage(
# Create an I-beam profile curve. Notice how we name our profiles
# based on standardised steel profile names.
hea100 = usecase.file.create_entity(
hea100 = model.create_entity(
"IfcIShapeProfileDef", ProfileName="HEA100", ProfileType="AREA",
OverallWidth=100, OverallDepth=96, WebThickness=5, FlangeThickness=8, FilletRadius=12,
)
@@ -74,7 +74,7 @@ def edit_profile_usage(
# Let's create an occurrence of this beam.
beam = ifcopenshell.api.root.create_entity(model, ifc_class="IfcBeam", name="B1.01")
rel = ifcopenshell.api.material.assign_material(model,
rel = ifcopenshell.api.material.assign_material(model, material=material_set,
products=[beam], type="IfcMaterialProfileSetUsage")
# Let's give a 1000mm long beam body representation.
@@ -40,7 +40,7 @@ def remove_profile(
.. code:: python
# First, let's create a material set.
material_set = ifcopenshell.api.material.add_profile_set(model,
material_set = ifcopenshell.api.material.add_material_set(model,
name="B1", set_type="IfcMaterialProfileSet")
# Create a steel material.