mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 19:52:36 +00:00
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:
@@ -67,7 +67,7 @@ def add_profile(
|
|||||||
|
|
||||||
# First, let's create a material set. This will later be assigned
|
# First, let's create a material set. This will later be assigned
|
||||||
# to our beam type element.
|
# 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")
|
name="B1", set_type="IfcMaterialProfileSet")
|
||||||
|
|
||||||
# Create a steel material.
|
# Create a steel material.
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ def assign_profile(
|
|||||||
|
|
||||||
# First, let's create a material set. This will later be assigned
|
# First, let's create a material set. This will later be assigned
|
||||||
# to our beam type element.
|
# 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")
|
name="B1", set_type="IfcMaterialProfileSet")
|
||||||
|
|
||||||
# Create a steel material.
|
# Create a steel material.
|
||||||
@@ -56,7 +56,7 @@ def assign_profile(
|
|||||||
|
|
||||||
# Create an I-beam profile curve. Notice how we name our profiles
|
# Create an I-beam profile curve. Notice how we name our profiles
|
||||||
# based on standardised steel profile names.
|
# based on standardised steel profile names.
|
||||||
hea100 = usecase.file.create_entity(
|
hea100 = model.create_entity(
|
||||||
"IfcIShapeProfileDef", ProfileName="HEA100", ProfileType="AREA",
|
"IfcIShapeProfileDef", ProfileName="HEA100", ProfileType="AREA",
|
||||||
OverallWidth=100, OverallDepth=96, WebThickness=5, FlangeThickness=8, FilletRadius=12,
|
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.
|
# Now let's change the profile to a HEA200 standard profile instead.
|
||||||
# This will automatically change the body representation that we
|
# This will automatically change the body representation that we
|
||||||
# just added as well to a HEA200 profile.
|
# just added as well to a HEA200 profile.
|
||||||
hea200 = usecase.file.create_entity(
|
hea200 = model.create_entity(
|
||||||
"IfcIShapeProfileDef", ProfileName="HEA200", ProfileType="AREA",
|
"IfcIShapeProfileDef", ProfileName="HEA200", ProfileType="AREA",
|
||||||
OverallWidth=200, OverallDepth=190, WebThickness=6.5, FlangeThickness=10, FilletRadius=18,
|
OverallWidth=200, OverallDepth=190, WebThickness=6.5, FlangeThickness=10, FilletRadius=18,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ def edit_profile(
|
|||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
# Let's create a material set to store our profiles.
|
# 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")
|
name="B1", set_type="IfcMaterialProfileSet")
|
||||||
|
|
||||||
# Create a couple steel materials.
|
# 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
|
# First, let's create a material set. This will later be assigned
|
||||||
# to our beam type element.
|
# 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")
|
name="B1", set_type="IfcMaterialProfileSet")
|
||||||
|
|
||||||
# Create a steel material.
|
# Create a steel material.
|
||||||
@@ -58,7 +58,7 @@ def edit_profile_usage(
|
|||||||
|
|
||||||
# Create an I-beam profile curve. Notice how we name our profiles
|
# Create an I-beam profile curve. Notice how we name our profiles
|
||||||
# based on standardised steel profile names.
|
# based on standardised steel profile names.
|
||||||
hea100 = usecase.file.create_entity(
|
hea100 = model.create_entity(
|
||||||
"IfcIShapeProfileDef", ProfileName="HEA100", ProfileType="AREA",
|
"IfcIShapeProfileDef", ProfileName="HEA100", ProfileType="AREA",
|
||||||
OverallWidth=100, OverallDepth=96, WebThickness=5, FlangeThickness=8, FilletRadius=12,
|
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.
|
# Let's create an occurrence of this beam.
|
||||||
beam = ifcopenshell.api.root.create_entity(model, ifc_class="IfcBeam", name="B1.01")
|
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")
|
products=[beam], type="IfcMaterialProfileSetUsage")
|
||||||
|
|
||||||
# Let's give a 1000mm long beam body representation.
|
# Let's give a 1000mm long beam body representation.
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def remove_profile(
|
|||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
# First, let's create a material set.
|
# 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")
|
name="B1", set_type="IfcMaterialProfileSet")
|
||||||
|
|
||||||
# Create a steel material.
|
# Create a steel material.
|
||||||
|
|||||||
Reference in New Issue
Block a user