diff --git a/src/blenderbim/docs/_static/custom.css b/src/blenderbim/docs/_static/custom.css
index f6939f3ac5..6e5709c7c9 100644
--- a/src/blenderbim/docs/_static/custom.css
+++ b/src/blenderbim/docs/_static/custom.css
@@ -8,9 +8,6 @@ h1, h2, h3, h4 {
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
-h1 code.literal {
- background: none;
-}
a {
text-decoration: none;
}
diff --git a/src/ifcopenshell-python/docs/_autoapi_templates/python/module.rst b/src/ifcopenshell-python/docs/_autoapi_templates/python/module.rst
index c522bf2092..cbd5f30094 100644
--- a/src/ifcopenshell-python/docs/_autoapi_templates/python/module.rst
+++ b/src/ifcopenshell-python/docs/_autoapi_templates/python/module.rst
@@ -17,8 +17,8 @@
{% block subpackages %}
{% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
{% if visible_subpackages %}
-Subpackagesa
-------------
+Subpackages
+-----------
.. toctree::
:titlesonly:
:maxdepth: 1
diff --git a/src/ifcopenshell-python/docs/_static/custom.css b/src/ifcopenshell-python/docs/_static/custom.css
index a32a849707..1c1de1de08 100644
--- a/src/ifcopenshell-python/docs/_static/custom.css
+++ b/src/ifcopenshell-python/docs/_static/custom.css
@@ -51,14 +51,32 @@ section img {
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
border-radius: 5px;
}
+
+/* Make it clearer which signatures are part of a class */
.py.class {
- /* Make it clearer which signatures are part of a class */
border-left: 3px solid var(--color-brand-primary);
}
-.py.function, .py.method {
- /* Make it clearer which signatures are part of a method or function */
- border-left: 3px solid var(--color-background-item);
+.py.class > .sig {
+ background: var(--color-brand-primary) !important;
+ margin: 0;
+ border-radius: 0;
}
+.py.class > .sig * {
+ color: #2e3436 !important;
+}
+.py.class > .sig a {
+ color: #fff;
+}
+
+/* Make it easier to spot functions and methods */
+.py.function, .py.method {
+ border-top: 1px solid var(--color-background-item);
+}
+dl.py.property, dl.py.attribute, dl.py.method, dl.py.function {
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+
.field-list > dt {
/* Clearly distinguish parameters otherwise it looks like a wall of text */
color: var(--color-brand-content);
diff --git a/src/ifcopenshell-python/docs/introduction/how_to_contribute.rst b/src/ifcopenshell-python/docs/introduction/how_to_contribute.rst
index 59015fe339..212eb0cba8 100644
--- a/src/ifcopenshell-python/docs/introduction/how_to_contribute.rst
+++ b/src/ifcopenshell-python/docs/introduction/how_to_contribute.rst
@@ -21,14 +21,15 @@ Python API documentation is autogenerated from docstrings present in the source
code of the respective Python module.
If you want to build the documentation locally, the documentation system uses
-`Sphinx `_. First, install the theme and
-theme dependencies:
+`Sphinx `_. First, install Sphinx and
+dependencies:
.. code-block:: console
- $ pip install furo
+ $ pip install sphinx
$ pip install sphinx-autoapi
$ pip install sphinx-copybutton
+ $ pip install furo
Now you can generate the documentation:
diff --git a/src/ifcopenshell-python/ifcopenshell/__init__.py b/src/ifcopenshell-python/ifcopenshell/__init__.py
index 75f5f426f4..739e99bbc6 100644
--- a/src/ifcopenshell-python/ifcopenshell/__init__.py
+++ b/src/ifcopenshell-python/ifcopenshell/__init__.py
@@ -168,7 +168,7 @@ def create_entity(type, schema="IFC4", *args, **kwargs):
"""Creates a new IFC entity that does not belong to an IFC file object
Note that it is more common to create entities within a existing file
- object. See :meth:`ifcopenshell.file.file.create_entity`.
+ object. See :meth:`ifcopenshell.file.create_entity`.
:param type: Case insensitive name of the IFC class
:type type: string
@@ -177,7 +177,7 @@ def create_entity(type, schema="IFC4", *args, **kwargs):
:param args: The positional arguments of the IFC class
:param kwargs: The keyword arguments of the IFC class
:returns: An entity instance
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :rtype: ifcopenshell.entity_instance
Example:
diff --git a/src/ifcopenshell-python/ifcopenshell/entity_instance.py b/src/ifcopenshell-python/ifcopenshell/entity_instance.py
index c1c4fd79b4..05ad3fd984 100644
--- a/src/ifcopenshell-python/ifcopenshell/entity_instance.py
+++ b/src/ifcopenshell-python/ifcopenshell/entity_instance.py
@@ -22,7 +22,6 @@ import importlib
import numbers
import itertools
import operator
-import functools
import subprocess
import sys
import time
@@ -33,7 +32,7 @@ from . import settings
try:
import logging
-except ImportError as e:
+except ImportError:
logging = type("logger", (object,), {"exception": staticmethod(lambda s: print(s))})
T = TypeVar("T")
@@ -101,20 +100,47 @@ for nm in ifcopenshell_wrapper.schema_names():
class entity_instance:
- """Base class for all IFC objects.
+ """Represents an entity (wall, slab, property, etc) of an IFC model
- An instantiated entity_instance will have methods of Python and the IFC class itself.
+ An IFC model consists of entities. Examples of entities include walls,
+ slabs, doors and so on. Entities can also be non-physical things, like
+ properties, systems, construction tasks, colours, geometry, and more.
+
+ Entities are defined through an **IFC Class**. There are hundreds of **IFC
+ Classes** defined as part of the ISO standard by the buildingSMART
+ International organisation. The **IFC Class** defines the attributes of an
+ entity, as well as the data types and whether or not an attribute is
+ mandatory or optional.
+
+ IfcOpenShell's API dynamically implements the IFC schema. You will not find
+ documentation about available **IFC Classes**, or what attributes they
+ have. Please consult the buildingSMART official documentation or start
+ reading :doc:`/introduction/introduction_to_ifc`.
+
+ In addition to the Python methods you see documented here, an instantiated
+ entity_instance will have attributes defined by its IFC class. For example,
+ an entity instance which is an IfcWall class will have a ``Name``
+ attribute, and an IfcColourRgb will have a ``Red`` attribute. Please
+ consult the buildingSMART official documentation.
Example:
.. code:: python
- ifc_file = ifcopenshell.open(file_path)
- products = ifc_file.by_type("IfcProduct")
- print(products[0].__class__)
- >>>
- print(products[0].Representation)
- >>> #423=IfcProductDefinitionShape($,$,(#409,#421))
+ model = ifcopenshell.open(file_path)
+ walls = model.by_type("IfcWall")
+ wall = walls[0]
+
+ print(wall) # #38=IFCWALL('2MEinnTPbCMwLOgceaQZFu',$,$,'My Wall',$,#52,#47,$,$);
+ print(wall.is_a()) # IfcWall
+
+ # Note: the `Name` attribute is dynamic, based on the IFC class.
+ print(wall.Name) # My Wall
+
+ # Attributes are ordered and may also be accessed via index.
+ print(wall[3]) # My Wall
+
+ print(wall.__class__) #
"""
wrapped_data: ifcopenshell_wrapper.entity_instance
diff --git a/src/ifcopenshell-python/ifcopenshell/file.py b/src/ifcopenshell-python/ifcopenshell/file.py
index 85be898392..fc2fb29f1c 100644
--- a/src/ifcopenshell-python/ifcopenshell/file.py
+++ b/src/ifcopenshell-python/ifcopenshell/file.py
@@ -307,7 +307,7 @@ class file:
:param args: The positional arguments of the IFC class
:param kwargs: The keyword arguments of the IFC class
:returns: An entity instance
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :rtype: ifcopenshell.entity_instance
Example:
@@ -402,8 +402,8 @@ class file:
:raises RuntimeError: If `id` is not found.
- :returns: An ifcopenshell.entity_instance.entity_instance
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :returns: An ifcopenshell.entity_instance
+ :rtype: ifcopenshell.entity_instance
"""
return self[id]
@@ -415,8 +415,8 @@ class file:
:raises RuntimeError: If `guid` is not found.
- :returns: An ifcopenshell.entity_instance.entity_instance
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :returns: An ifcopenshell.entity_instance
+ :rtype: ifcopenshell.entity_instance
"""
return self[guid]
@@ -426,9 +426,9 @@ class file:
If the entity already exists, it is not re-added. Existence of entity is checked by it's `.identity()`.
:param inst: The entity instance to add
- :type inst: ifcopenshell.entity_instance.entity_instance
- :returns: An ifcopenshell.entity_instance.entity_instance
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :type inst: ifcopenshell.entity_instance
+ :returns: An ifcopenshell.entity_instance
+ :rtype: ifcopenshell.entity_instance
"""
if self.transaction:
@@ -452,8 +452,8 @@ class file:
:raises RuntimeError: If `type` is not found in IFC schema.
- :returns: A list of ifcopenshell.entity_instance.entity_instance objects
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :returns: A list of ifcopenshell.entity_instance objects
+ :rtype: list[ifcopenshell.entity_instance]
"""
if include_subtypes:
return [entity_instance(e, self) for e in self.wrapped_data.by_type(type)]
@@ -465,13 +465,13 @@ class file:
"""Get a list of all referenced instances for a particular instance including itself
:param inst: The entity instance to get all sub instances
- :type inst: ifcopenshell.entity_instance.entity_instance
+ :type inst: ifcopenshell.entity_instance
:param max_levels: How far deep to recursively fetch sub instances. None or -1 means infinite.
:type max_levels: None|int
:param breadth_first: Whether to use breadth-first search, the default is depth-first.
:type max_levels: bool
- :returns: A list of ifcopenshell.entity_instance.entity_instance objects
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :returns: A list of ifcopenshell.entity_instance objects
+ :rtype: list[ifcopenshell.entity_instance]
"""
if max_levels is None:
max_levels = -1
@@ -489,12 +489,12 @@ class file:
"""Return a list of entities that reference this entity
:param inst: The entity instance to get inverse relationships
- :type inst: ifcopenshell.entity_instance.entity_instance
+ :type inst: ifcopenshell.entity_instance
:param allow_duplicate: Returns a `list` when True, `set` when False
:param with_attribute_indices: Returns pairs of
where i[idx] is inst or contains inst. Requires allow_duplicate=True
- :returns: A list of ifcopenshell.entity_instance.entity_instance objects
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :returns: A list of ifcopenshell.entity_instance objects
+ :rtype: list[ifcopenshell.entity_instance]
"""
if with_attribute_indices and not allow_duplicate:
raise ValueError("with_attribute_indices requires allow_duplicate to be True")
@@ -514,7 +514,7 @@ class file:
"""Returns the number of entities that reference this entity
:param inst: The entity instance to get inverse relationships
- :type inst: ifcopenshell.entity_instance.entity_instance
+ :type inst: ifcopenshell.entity_instance
:returns: The total number of references
:rtype: int
"""
@@ -528,7 +528,7 @@ class file:
the reference to the deleted will be removed from the aggregate.
:param inst: The entity instance to delete
- :type inst: ifcopenshell.entity_instance.entity_instance
+ :type inst: ifcopenshell.entity_instance
:rtype: None
"""
if self.transaction:
diff --git a/src/ifcopenshell-python/ifcopenshell/util/constraint.py b/src/ifcopenshell-python/ifcopenshell/util/constraint.py
index b8f6aac14f..f4e18d61b3 100644
--- a/src/ifcopenshell-python/ifcopenshell/util/constraint.py
+++ b/src/ifcopenshell-python/ifcopenshell/util/constraint.py
@@ -27,9 +27,9 @@ def get_constraints(product: ifcopenshell.entity_instance) -> list[ifcopenshell.
Retrieves the constraints assigned to the `product`.
:param product: The IFC element.
- :type product: ifcopenshell.entity_instance.entity_instance
+ :type product: ifcopenshell.entity_instance
:return: List of assigned constraints.
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
"""
constraints = []
for rel in product.HasAssociations or []:
@@ -43,9 +43,9 @@ def get_constrained_elements(constraint: ifcopenshell.entity_instance) -> set[if
Retrieves the elements constrained by a `constraint`.
:param product: The IFC element.
- :type product: ifcopenshell.entity_instance.entity_instance
+ :type product: ifcopenshell.entity_instance
:return: Set of elements constrained by a `constrant`.
- :rtype: set[ifcopenshell.entity_instance.entity_instance]
+ :rtype: set[ifcopenshell.entity_instance]
"""
elements = set()
for rel in constraint.file.get_inverse(constraint):
@@ -59,9 +59,9 @@ def get_metrics(constraint: ifcopenshell.entity_instance) -> list[ifcopenshell.e
Retrieves the list of nested constraints for a IfcObjective `constraint`.
:param product: IfcObjective constraint.
- :type product: ifcopenshell.entity_instance.entity_instance
+ :type product: ifcopenshell.entity_instance
:return: List of nested constraints.
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
"""
metrics = []
diff --git a/src/ifcopenshell-python/ifcopenshell/util/element.py b/src/ifcopenshell-python/ifcopenshell/util/element.py
index bb23d1c95a..70c110a63d 100644
--- a/src/ifcopenshell-python/ifcopenshell/util/element.py
+++ b/src/ifcopenshell-python/ifcopenshell/util/element.py
@@ -40,7 +40,7 @@ def get_pset(
occurrence, not the type's pset.
:param element: The IFC Element entity
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:param name: The name of the pset
:type name: str
:param prop: The name of the property
@@ -128,7 +128,7 @@ def get_psets(
occurrence, not the type's pset.
:param element: The IFC Element entity
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:param psets_only: Default as False. Set to true if only property sets are needed.
:type psets_only: bool,optional
:param qtos_only: Default as False. Set to true if only quantities are needed.
@@ -418,7 +418,7 @@ def get_predefined_type(element: ifcopenshell.entity_instance) -> str:
considered first.
:param element: The IFC Element entity
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: The predefined type of the element
:rtype: str
@@ -448,9 +448,9 @@ def get_type(element: ifcopenshell.entity_instance) -> ifcopenshell.entity_insta
"""Retrieves the construction type element of an element occurrence
:param element: The element occurrence
- :type: ifcopenshell.entity_instance.entity_instance
+ :type: ifcopenshell.entity_instance
:return: The related type element
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :rtype: ifcopenshell.entity_instance
Example:
@@ -473,9 +473,9 @@ def get_types(type: ifcopenshell.entity_instance) -> list[ifcopenshell.entity_in
"""Get all the occurrences of a type element
:param type: The type element
- :type type: ifcopenshell.entity_instance.entity_instance
+ :type type: ifcopenshell.entity_instance
:return: A list of occurrences of that type
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -495,9 +495,9 @@ def get_shape_aspects(element: ifcopenshell.entity_instance) -> list[ifcopenshel
"""Gets element shape aspects
:param element: The element to get the shape aspects of.
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: The associated shape aspects of the element.
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -530,7 +530,7 @@ def get_material(
constituent), or a material set usage.
:param element: The element to get the material of.
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:param should_skip_usage: If set to True, if the material is a material set
usage, the material set itself will be returned. Useful if you don't
care about occurrence usage parameters. If False, the usage will be
@@ -540,7 +540,7 @@ def get_material(
types will be considered.
:type should_inherit: bool
:return: The associated material of the element or `None`.
- :rtype: Union[ifcopenshell.entity_instance.entity_instance, None]
+ :rtype: Union[ifcopenshell.entity_instance, None]
Example:
@@ -574,11 +574,11 @@ def get_materials(
returned as a list.
:param element: The element to get the materials of.
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:param should_inherit: If True, any inherited materials from associated
types will be considered.
:return: The associated materials of the element.
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -608,9 +608,9 @@ def get_styles(element: ifcopenshell.entity_instance) -> list[ifcopenshell.entit
Styles may be retreived from the material or the body representation.
:param element: The element to get the styles of.
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: A list of surface styles
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -655,11 +655,11 @@ def get_elements_by_material(
usage.
:param ifc_file: The IFC file
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param material: The IFC Material entity
- :type material: ifcopenshell.entity_instance.entity_instance
+ :type material: ifcopenshell.entity_instance
:return: A list of elements using the to the material
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -696,11 +696,11 @@ def get_elements_by_style(
"""Retrieves the elements whose geometric representation uses a style
:param ifc_file: The IFC file
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param style: The IfcPresentationStyle entity
- :type style: ifcopenshell.entity_instance.entity_instance
+ :type style: ifcopenshell.entity_instance
:return: The elements related to the style
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -738,11 +738,11 @@ def get_elements_by_representation(
"""Gets all elements using a geometric representation
:param ifc_file: The IFC file
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param representation: The IfcShapeRepresentation representation
- :type representation: ifcopenshell.entity_instance.entity_instance
+ :type representation: ifcopenshell.entity_instance
:return: The elements using the geometric representation
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -772,11 +772,11 @@ def get_elements_by_layer(
"""Get all the elements that are used by a presentation layer
:param ifc_file: The IFC file
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param layer: The IfcPresentationLayerAssignment layer
- :type layer: ifcopenshell.entity_instance.entity_instance
+ :type layer: ifcopenshell.entity_instance
:return: The elements using the geometric representation
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
"""
results = set()
for item in layer.AssignedItems or []:
@@ -798,11 +798,11 @@ def get_layers(
traditional CAD presentation layer.
:param ifc_file: The IFC file object
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param element: The IFC element to interrogate
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: A list of IfcPresentationLayerAssignment
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -836,7 +836,7 @@ def get_container(
Retrieves the spatial structure container of an element.
:param element: The IFC element
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:param should_get_direct: If True, a result is only returned if the element
is directly contained in a spatial structure element. If False, an
indirect spatial container may be returned, such as if an element is a
@@ -847,7 +847,7 @@ def get_container(
example, you may be after the storey, not a space.
:type ifc_class: str, optional
:return: The direct or indirect container of the element or None.
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :rtype: ifcopenshell.entity_instance
Example:
@@ -892,9 +892,9 @@ def get_referenced_structures(element: ifcopenshell.entity_instance) -> list[ifc
as stairs, doors, etc.
:param element: The IFC element
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: A list of IfcSpatialElement
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -910,9 +910,9 @@ def get_structure_referenced_elements(structure: ifcopenshell.entity_instance) -
"""Retreives a set of elements referenced by a structure
:param structure: IfcSpatialElement
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: A set of referenced elements, IfcSpatialReferenceSelect
- :rtype: set[ifcopenshell.entity_instance.entity_instance]
+ :rtype: set[ifcopenshell.entity_instance]
Example:
@@ -934,9 +934,9 @@ def get_decomposition(element: ifcopenshell.entity_instance, is_recursive=True)
parts of an aggreate, all openings, and all fills of any openings.
:param element: The IFC element
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: The decomposition of the element
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -978,9 +978,9 @@ def get_grouped_by(element: ifcopenshell.entity_instance) -> list[ifcopenshell.e
"""Retrieves all subelements of an element based on the group.
:param element: The IFC element
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: All subelements of the group
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -1006,7 +1006,7 @@ def get_groups(element: ifcopenshell.entity_instance) -> list[ifcopenshell.entit
:param element: The IFC element
:return: List of IfcGroups element is assigned to.
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -1027,9 +1027,9 @@ def get_aggregate(element: ifcopenshell.entity_instance) -> ifcopenshell.entity_
Retrieves the aggregate parent of an element.
:param element: The IFC element
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: The aggregate of the element
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :rtype: ifcopenshell.entity_instance
Example:
@@ -1048,9 +1048,9 @@ def get_nest(element: ifcopenshell.entity_instance) -> ifcopenshell.entity_insta
Retrieves the nest parent of an element.
:param element: The IFC element
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: The nested whole of the element
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :rtype: ifcopenshell.entity_instance
Example:
@@ -1072,9 +1072,9 @@ def get_parts(element: ifcopenshell.entity_instance) -> list[ifcopenshell.entity
Retrieves the parts of an element that have an aggregation relationship.
:param element: The IFC element
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: The parts of the element
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -1098,7 +1098,7 @@ def get_components(element: ifcopenshell.entity_instance, include_ports=False) -
:param include_ports: Default as False. Set to true if you also want to get ports.
:type include_ports: bool,optional
:return: The components of the element
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
Example:
@@ -1141,9 +1141,9 @@ def get_referenced_elements(reference: ifcopenshell.entity_instance) -> set[ifco
"""Get all elements with assigned `reference`
:param reference: IfcExternalReference subtype reference
- :type reference: ifcopenshell.entity_instance.entity_instance
+ :type reference: ifcopenshell.entity_instance
:return: The elements with assigned `reference`
- :rtype: set[ifcopenshell.entity_instance.entity_instance]
+ :rtype: set[ifcopenshell.entity_instance]
Example:
@@ -1222,7 +1222,7 @@ def batch_remove_deep2(ifc_file: ifcopenshell.file) -> None:
on existing variables in memory.
:param ifc_file: The IFC file object
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:rtype: None
Example:
@@ -1249,9 +1249,9 @@ def unbatch_remove_deep2(ifc_file: ifcopenshell.file) -> ifcopenshell.file:
See documentation for batch_remove_deep2.
:param ifc_file: The IFC file object
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:return: A newly loaded file with the elements removed.
- :rtype: ifcopenshell.file.file
+ :rtype: ifcopenshell.file
"""
ifc_string = ifc_file.to_string()
lines = iter(ifc_string.split("\n"))
@@ -1304,13 +1304,13 @@ def remove_deep2(
subgraph but are protected from deletion.
:param ifc_file: The IFC file object
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param also_consider: elements to also consider as a part of a subgraph
- :type also_consider: list[ifcopenshell.entity_instance.entity_instance], optional
+ :type also_consider: list[ifcopenshell.entity_instance], optional
:param do_not_delete: elements to protect from deletion
- :type do_not_delete: list[ifcopenshell.entity_instance.entity_instance], optional
+ :type do_not_delete: list[ifcopenshell.entity_instance], optional
:param element: The starting element that defines the subgraph
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
"""
# ifc_file.batch()
to_delete = set()
@@ -1357,11 +1357,11 @@ def copy(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) ->
GlobalIds are regenerated.
:param ifc_file: The IFC file object
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param element: The IFC element to copy
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:return: The newly copied element
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :rtype: ifcopenshell.entity_instance
"""
new = ifc_file.create_entity(element.is_a())
for i, attribute in enumerate(element):
@@ -1387,9 +1387,9 @@ def copy_deep(
GlobalIds are regenerated.
:param ifc_file: The IFC file object
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param element: The IFC element to copy
- :type element: ifcopenshell.entity_instance.entity_instance
+ :type element: ifcopenshell.entity_instance
:param exclude: An optional list of strings of IFC class names to not copy.
If any of the subelement is this class, it will not be copied and the
original instance will be referenced.
@@ -1400,9 +1400,9 @@ def copy_deep(
:param copied_entities: A dictionary of IDs as keys and entities as values
to reuse when coming across the same entity twice. This can typically
be left as None.
- :type copied_entities: dict[int:ifcopenshell.entity_instance.entity_instance], optional
+ :type copied_entities: dict[int:ifcopenshell.entity_instance], optional
:return: The newly copied element
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :rtype: ifcopenshell.entity_instance
"""
if copied_entities is None:
copied_entities = {}
diff --git a/src/ifcopenshell-python/ifcopenshell/util/geolocation.py b/src/ifcopenshell-python/ifcopenshell/util/geolocation.py
index 7128630c2f..ffe2d9228f 100644
--- a/src/ifcopenshell-python/ifcopenshell/util/geolocation.py
+++ b/src/ifcopenshell-python/ifcopenshell/util/geolocation.py
@@ -147,7 +147,7 @@ def auto_xyz2enh(ifc_file, x, y, z):
https://www.buildingsmart.org/standards/bsi-standards/standards-library/
:param ifc_file: The IFC file
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param x: The X local engineering coordinate provided in project length units.
:type x: float
:param y: The Y local engineering coordinate provided in project length units.
@@ -215,7 +215,7 @@ def auto_enh2xyz(ifc_file, easting, northing, height):
https://www.buildingsmart.org/standards/bsi-standards/standards-library/
:param ifc_file: The IFC file
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param easting: The global easting map coordinate provided in map units.
:type easting: float
:param northing: The global northing map coordinate provided in map units.
@@ -283,7 +283,7 @@ def auto_z2e(ifc_file, z):
https://www.buildingsmart.org/standards/bsi-standards/standards-library/
:param ifc_file: The IFC file
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param z: The Z local engineering coordinate provided in project length units.
:type z: float
:return: The elevation in project length units.
@@ -587,7 +587,7 @@ def get_grid_north(ifc_file):
https://www.buildingsmart.org/standards/bsi-standards/standards-library/
:param ifc_file: The IFC file
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:return: An angle to grid north in decimal degrees
:rtype: float
"""
@@ -623,7 +623,7 @@ def get_true_north(ifc_file):
instead.
:param ifc_file: The IFC file
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:return: An angle to true north in decimal degrees
:rtype: float
"""
diff --git a/src/ifcopenshell-python/ifcopenshell/util/placement.py b/src/ifcopenshell-python/ifcopenshell/util/placement.py
index a5c3312dab..75a1de6265 100644
--- a/src/ifcopenshell-python/ifcopenshell/util/placement.py
+++ b/src/ifcopenshell-python/ifcopenshell/util/placement.py
@@ -60,7 +60,7 @@ def get_axis2placement(placement: ifcopenshell.entity_instance) -> MatrixType:
should use ``get_local_placement`` instead.
:param placement: The IfcLocalPlacement enitity
- :type placement: ifcopenshell.entity_instance.entity_instance
+ :type placement: ifcopenshell.entity_instance
:return: A 4x4 numpy matrix
:rtype: MatrixType
"""
@@ -118,7 +118,7 @@ def get_local_placement(placement: ifcopenshell.entity_instance) -> MatrixType:
matrix = ifcopenshell.util.placement.get_local_placement(placement)
:param placement: The IfcLocalPlacement entity
- :type placement: ifcopenshell.entity_instance.entity_instance
+ :type placement: ifcopenshell.entity_instance
:return: A 4x4 numpy matrix
:rtype: MatrixType
"""
@@ -138,7 +138,7 @@ def get_cartesiantransformationoperator3d(inst: ifcopenshell.entity_instance) ->
``get_mappeditem_transformation`` instead.
:param item: The IfcCartesianTransformationOperator entity
- :type item: ifcopenshell.entity_instance.entity_instance
+ :type item: ifcopenshell.entity_instance
:return: A 4x4 numpy transformation matrix
:rtype: MatrixType
"""
@@ -184,7 +184,7 @@ def get_mappeditem_transformation(item: ifcopenshell.entity_instance) -> MatrixT
transformation matrix.
:param item: The IfcMappedItem entity
- :type item: ifcopenshell.entity_instance.entity_instance
+ :type item: ifcopenshell.entity_instance
:return: A 4x4 numpy transformation matrix
:rtype: MatrixType
"""
@@ -201,7 +201,7 @@ def get_storey_elevation(storey: ifcopenshell.entity_instance) -> float:
its placement, or as a fallback the ``Elevation`` attribute.
:param storey: The IfcBuildingStorey entity
- :type storey: ifcopenshell.entity_instance.entity_instance
+ :type storey: ifcopenshell.entity_instance
:return: The elevation in project units
:rtype: float
"""
diff --git a/src/ifcopenshell-python/ifcopenshell/util/representation.py b/src/ifcopenshell-python/ifcopenshell/util/representation.py
index 95e91490d0..9bbfc783c4 100644
--- a/src/ifcopenshell-python/ifcopenshell/util/representation.py
+++ b/src/ifcopenshell-python/ifcopenshell/util/representation.py
@@ -88,9 +88,9 @@ def resolve_representation(representation: ifcopenshell.entity_instance) -> ifco
"""Resolve possibly mapped representation.
:param representation: IfcRepresentation
- :type representation: ifcopenshell.entity_instance.entity_instance
+ :type representation: ifcopenshell.entity_instance
:return: Representation resolved from mappings
- :rtype: ifcopenshell.entity_instance.entity_instance
+ :rtype: ifcopenshell.entity_instance
"""
if len(representation.Items) == 1 and representation.Items[0].is_a("IfcMappedItem"):
return resolve_representation(representation.Items[0].MappingSource.MappedRepresentation)
diff --git a/src/ifcopenshell-python/ifcopenshell/util/selector.py b/src/ifcopenshell-python/ifcopenshell/util/selector.py
index 15ba9e0762..d713a331c4 100644
--- a/src/ifcopenshell-python/ifcopenshell/util/selector.py
+++ b/src/ifcopenshell-python/ifcopenshell/util/selector.py
@@ -287,17 +287,17 @@ def filter_elements(
Filter elements based on the provided `query`.
:param ifc_file: The IFC file object
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param query: Query to execute
:type query: str
:param elements: Base set of IFC elements for the query.
If provided, new elements found for the current query will be added to `elements`.
Elements explicitly excluded in the `query` will also be excluded from `elements`
- :type elements: set[ifcopenshell.entity_instance.entity_instance], optional
+ :type elements: set[ifcopenshell.entity_instance], optional
:param edit_in_place: If `True`, mutate the provided `elements` in place. Defaults to `False`
:type edit_in_place: bool
:return: Set of filtered elements
- :rtype: set[ifcopenshell.entity_instance.entity_instance]
+ :rtype: set[ifcopenshell.entity_instance]
Example:
diff --git a/src/ifcopenshell-python/ifcopenshell/util/shape.py b/src/ifcopenshell-python/ifcopenshell/util/shape.py
index 931f4c0327..1915c6cde0 100644
--- a/src/ifcopenshell-python/ifcopenshell/util/shape.py
+++ b/src/ifcopenshell-python/ifcopenshell/util/shape.py
@@ -161,7 +161,7 @@ def get_element_bbox_centroid(element: ifcopenshell.entity_instance, geometry) -
is more efficient to use ``get_shape_bbox_centroid``.
:param element: The element occurrence
- :type: ifcopenshell.entity_instance.entity_instance
+ :type: ifcopenshell.entity_instance
:param geometry: Geometry output calculated by IfcOpenShell
:type geometry: geometry
:return: A tuple representing the XYZ centroid
@@ -271,7 +271,7 @@ def get_element_vertices(element: ifcopenshell.entity_instance, geometry) -> npt
Results are a nested numpy array e.g. [[v1x, v1y, v1z], [v2x, v2y, v2z], ...]
:param element: The element occurrence
- :type: ifcopenshell.entity_instance.entity_instance
+ :type: ifcopenshell.entity_instance
:param geometry: Geometry output calculated by IfcOpenShell
:type geometry: geometry
:return: A numpy array listing all the vertices. Each vertex is a numpy array with XYZ coordinates.
@@ -347,7 +347,7 @@ def get_element_bottom_elevation(element: ifcopenshell.entity_instance, geometry
``get_shape_bottom_elevation``.
:param element: The element occurrence
- :type: ifcopenshell.entity_instance.entity_instance
+ :type: ifcopenshell.entity_instance
:param geometry: Geometry output calculated by IfcOpenShell
:type geometry: geometry
:return: The Z value
@@ -363,7 +363,7 @@ def get_element_top_elevation(element: ifcopenshell.entity_instance, geometry) -
``get_shape_top_elevation``.
:param element: The element occurrence
- :type: ifcopenshell.entity_instance.entity_instance
+ :type: ifcopenshell.entity_instance
:param geometry: Geometry output calculated by IfcOpenShell
:type geometry: geometry
:return: The Z value
@@ -656,9 +656,9 @@ def get_profiles(element: ifcopenshell.entity_instance) -> list[ifcopenshell.ent
solid extrusions. This is useful for later doing 2D take-off from profiles.
:param element: The element occurrence
- :type: ifcopenshell.entity_instance.entity_instance
+ :type: ifcopenshell.entity_instance
:return: A list of profiles
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
"""
material = ifcopenshell.util.element.get_material(element, should_skip_usage=True)
if material and material.is_a("IfcMaterialProfileSet"):
@@ -670,9 +670,9 @@ def get_extrusions(element: ifcopenshell.entity_instance) -> list[ifcopenshell.e
"""Gets all extruded area solids used to define an element's model body geometry
:param element: The element occurrence
- :type: ifcopenshell.entity_instance.entity_instance
+ :type: ifcopenshell.entity_instance
:return: A list of extrusion representation items
- :rtype: list[ifcopenshell.entity_instance.entity_instance]
+ :rtype: list[ifcopenshell.entity_instance]
"""
representation = ifcopenshell.util.representation.get_representation(element, "Model", "Body", "MODEL_VIEW")
if not representation:
diff --git a/src/ifcopenshell-python/ifcopenshell/util/unit.py b/src/ifcopenshell-python/ifcopenshell/util/unit.py
index 0e2604e481..fdbee952a4 100644
--- a/src/ifcopenshell-python/ifcopenshell/util/unit.py
+++ b/src/ifcopenshell-python/ifcopenshell/util/unit.py
@@ -398,7 +398,7 @@ def get_project_unit(ifc_file: ifcopenshell.file, unit_type: str) -> Union[ifcop
"""Get the default project unit of a particular unit type
:param ifc_file: The IFC file.
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param unit_type: The type of unit, taken from the list of IFC unit types,
such as "LENGTHUNIT".
:type unit_type: str
@@ -536,9 +536,9 @@ def convert_unit(value: float, from_unit: ifcopenshell.entity_instance, to_unit:
:param value: The numeric value you want to convert
:type value: float
:param from_unit: The IfcNamedUnit to confirm from.
- :type from_unit: ifcopenshell.entity_instance.entity_instance
+ :type from_unit: ifcopenshell.entity_instance
:param to_unit: The IfcNamedUnit to confirm from.
- :type to_unit: ifcopenshell.entity_instance.entity_instance
+ :type to_unit: ifcopenshell.entity_instance
:return: The converted value.
:rtype: float
"""
@@ -599,7 +599,7 @@ def calculate_unit_scale(ifc_file: ifcopenshell.file, unit_type: str = "LENGTHUN
si_meters / unit_scale = ifc_project_length
:param ifc_file: The IFC file.
- :type ifc_file: ifcopenshell.file.file
+ :type ifc_file: ifcopenshell.file
:param unit_type: The type of SI unit, defaults to "LENGTHUNIT"
:type unit_type: str
:returns: The scale factor