This commit is contained in:
Andrej730
2024-05-09 14:18:36 +05:00
parent 359dab573b
commit 2d35869c41
57 changed files with 221 additions and 109 deletions
@@ -21,7 +21,11 @@ import ifcopenshell.api
import ifcopenshell.guid
def assign_product(file, relating_product=None, related_object=None) -> None:
def assign_product(
file: ifcopenshell.file,
relating_product: ifcopenshell.entity_instance,
related_object: ifcopenshell.entity_instance,
) -> ifcopenshell.entity_instance:
"""Associates a product and an object, typically for annotation
Warning: this is an experimental API.
@@ -104,7 +108,7 @@ def assign_product(file, relating_product=None, related_object=None) -> None:
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", file),
"RelatedObjects": [settings["related_object"]],
"RelatingProduct": settings["relating_product"],
}
},
)
if is_grid_axis:
@@ -15,9 +15,13 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
from typing import Any
def edit_text_literal(file, text_literal=None, attributes=None) -> None:
def edit_text_literal(
file: ifcopenshell.file, text_literal: ifcopenshell.entity_instance, attributes: dict[str, Any]
) -> None:
"""Edits the attributes of an IfcTextLiteral
For more information about the attributes and data types of an
@@ -26,7 +30,7 @@ def edit_text_literal(file, text_literal=None, attributes=None) -> None:
:param reference: The IfcTextLiteral entity you want to edit
:type reference: ifcopenshell.entity_instance
:param attributes: a dictionary of attribute names and values.
:type attributes: dict, optional
:type attributes: dict
:return: None
:rtype: None
@@ -21,7 +21,11 @@ import ifcopenshell.api
import ifcopenshell.util.element
def unassign_product(file, relating_product=None, related_object=None) -> None:
def unassign_product(
file: ifcopenshell.file,
relating_product: ifcopenshell.entity_instance,
related_object: ifcopenshell.entity_instance,
) -> None:
"""Unassigns a product and an object (typically an annotation)
Smart annotation objects can be associated with products so that they
@@ -34,8 +38,8 @@ def unassign_product(file, relating_product=None, related_object=None) -> None:
:param related_object: The object (typically IfcAnnotation) that the
product is related to
:type related_object: ifcopenshell.entity_instance
:return: The created IfcRelAssignsToProduct relationship
:rtype: ifcopenshell.entity_instance
:return: None
:rtype: None
Example:
@@ -68,4 +72,3 @@ def unassign_product(file, relating_product=None, related_object=None) -> None:
related_objects.remove(settings["related_object"])
rel.RelatedObjects = related_objects
ifcopenshell.api.run("owner.update_owner_history", file, **{"element": rel})
return rel