mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
typing
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
import ifcopenshell.api.style
|
import ifcopenshell.api.style
|
||||||
import ifcopenshell.util.element
|
import ifcopenshell.util.element
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
|
|
||||||
def remove_style(file: ifcopenshell.file, style: ifcopenshell.entity_instance) -> None:
|
def remove_style(file: ifcopenshell.file, style: ifcopenshell.entity_instance) -> None:
|
||||||
@@ -47,6 +48,9 @@ def remove_style(file: ifcopenshell.file, style: ifcopenshell.entity_instance) -
|
|||||||
|
|
||||||
|
|
||||||
class Usecase:
|
class Usecase:
|
||||||
|
file: ifcopenshell.file
|
||||||
|
settings: dict[str, Any]
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
self.purge_styled_items(self.settings["style"])
|
self.purge_styled_items(self.settings["style"])
|
||||||
for style in self.settings["style"].Styles or []:
|
for style in self.settings["style"].Styles or []:
|
||||||
|
|||||||
@@ -706,18 +706,15 @@ def get_styles(element: ifcopenshell.entity_instance) -> list[ifcopenshell.entit
|
|||||||
# since we have entity_instance.file, so we can deprecate it.
|
# since we have entity_instance.file, so we can deprecate it.
|
||||||
def get_elements_by_material(
|
def get_elements_by_material(
|
||||||
ifc_file: ifcopenshell.file, material: ifcopenshell.entity_instance
|
ifc_file: ifcopenshell.file, material: ifcopenshell.entity_instance
|
||||||
) -> list[ifcopenshell.entity_instance]:
|
) -> set[ifcopenshell.entity_instance]:
|
||||||
"""Retrieves the elements related to a material.
|
"""Retrieves the elements related to a material.
|
||||||
|
|
||||||
This includes elements using the material as part of a material set or set
|
This includes elements using the material as part of a material set or set
|
||||||
usage.
|
usage.
|
||||||
|
|
||||||
:param ifc_file: The IFC file
|
:param ifc_file: The IFC file
|
||||||
:type ifc_file: ifcopenshell.file
|
|
||||||
:param material: The IFC Material entity
|
:param material: The IFC Material entity
|
||||||
:type material: ifcopenshell.entity_instance
|
:return: A set of elements using the to the material
|
||||||
:return: A list of elements using the to the material
|
|
||||||
:rtype: list[ifcopenshell.entity_instance]
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user