ifcopenshell.api.profile

Submodules

Package Contents

ifcopenshell.api.profile.add_arbitrary_profile(file, profile=None, name=None) None

Adds a new arbitrary polyline-based profile

The profile is represented as a polyline defined by a list of coordinates. Only straight segments are allowed. Coordinates must be provided in SI meters.

To represent a closed curve, the first and last coordinate must be identical.

Parameters:
  • profile (list[list[float]]) – A list of coordinates

  • name (str, optional) – If the profile is semantically significant (i.e. to be managed and reused by the user) then it must be named. Otherwise, this may be left as none.

Returns:

The newly created IfcArbitraryClosedProfileDef

Return type:

ifcopenshell.entity_instance

Example:

# A 10mm by 100mm rectangle, such that might be used as a wooden
# skirting board or kick plate.
square = ifcopenshell.api.run("profile.add_arbitrary_profile", model,
    profile=[(0., 0.), (.01, 0.), (.01, .1), (0., .1), (0., 0.)],
    name="SK01 Profile")
ifcopenshell.api.profile.add_arbitrary_profile_with_voids(file, outer_profile=None, inner_profiles=None, name=None) None

Adds a new arbitrary polyline-based profile with voids

The outer profile is represented as a polyline defined by a list of coordinates. Only straight segments are allowed. Coordinates must be provided in SI meters.

To represent a closed curve, the first and last coordinate must be identical.

The inner profiles are represented as a list of polylines. Every polyline in defined by a list of coordinates. Only straight segments are allowed. Coordinates must be provided in SI meters.

Parameters:
  • outer_profile – A list of coordinates

  • inner_profiles – A list of polylines

  • name (str, optional) – If the profile is semantically significant (i.e. to be managed and reused by the user) then it must be named. Otherwise, this may be left as none.

Returns:

The newly created IfcArbitraryProfileDefWithVoids

Return type:

ifcopenshell.entity_instance

Example:

# A 400mm by 400mm square with a 200mm by 200mm hole in it.
square_with_hole = ifcopenshell.api.run("profile.add_arbitrary_profile_with_voids", model,
    outer_profile=[(0., 0.), (.4, 0.), (.4, .4), (0., .4), (0., 0.)],
    inner_profiles=[[(0.1, 0.1), (0.3, 0.1), (0.3, 0.3), (0.1, 0.3), (0.1, 0.1)]],
    name="SK01 Hole Profile")
ifcopenshell.api.profile.add_parameterized_profile(file, ifc_class=None) None

Adds a new parameterised profile

IFC offers parameterised profiles for common standardised hot roll steel sections and common concrete forms. A full list is available on the IFC documentation as subclasses of IfcParameterizedProfileDef.

Currently, this API has no benefit over directly calling ifcopenshell.file.create_entity.

Parameters:

ifc_class (str) – The subclass of IfcParameterizedProfileDef that you’d like to create.

Returns:

The newly created element depending on the specified ifc_class.

Return type:

ifcopenshell.entity_instance

Example:

circle = ifcopenshell.api.run("profile.add_parameterized_profile", model,
    ifc_class="IfcCircleProfileDef")
circle.Radius = 1.
ifcopenshell.api.profile.edit_profile(file, profile=None, attributes=None) None

Edits the attributes of an IfcProfileDef

For more information about the attributes and data types of an IfcProfileDef, consult the IFC documentation.

Parameters:
  • profile (ifcopenshell.entity_instance) – The IfcProfileDef entity you want to edit

  • attributes (dict, optional) – a dictionary of attribute names and values.

Returns:

None

Return type:

None

Example:

circle = ifcopenshell.api.run("profile.add_parameterized_profile", model,
    ifc_class="IfcCircleProfileDef")
circle = 1.

ifcopenshell.api.run("profile.edit_profile", model,
    profile=circle, attributes={"ProfileName": "1000mm Dia"})
ifcopenshell.api.profile.remove_profile(file, profile=None) None

Removes a profile

Parameters:

profile (ifcopenshell.entity_instance) – The IfcProfileDef to remove.

Returns:

None

Return type:

None

Example:

circle = ifcopenshell.api.run("profile.add_parameterized_profile", model,
    ifc_class="IfcCircleProfileDef")
circle = 1.
ifcopenshell.api.run("profile.remove_profile", model, profile=circle)