mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 10:57:49 +00:00
Generate functions for all API usecases for better static code features. See #2693.
This commit is contained in:
@@ -15,3 +15,9 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from .add_pset import add_pset
|
||||
from .add_qto import add_qto
|
||||
from .edit_pset import edit_pset
|
||||
from .edit_qto import edit_qto
|
||||
from .remove_pset import remove_pset
|
||||
|
||||
@@ -19,133 +19,127 @@
|
||||
import ifcopenshell
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, product=None, name=None):
|
||||
"""Adds a new property set to a product
|
||||
def add_pset(file, product=None, name=None) -> None:
|
||||
"""Adds a new property set to a product
|
||||
|
||||
Products, such as physical objects or types in IFC may have properties
|
||||
associated with them. These properties are typically simple key value
|
||||
metadata with data types. For example, a wall type may have a property
|
||||
called FireRating with a text value of "2HR". Properties are grouped
|
||||
into property sets, so that related properties are grouped together.
|
||||
Products, such as physical objects or types in IFC may have properties
|
||||
associated with them. These properties are typically simple key value
|
||||
metadata with data types. For example, a wall type may have a property
|
||||
called FireRating with a text value of "2HR". Properties are grouped
|
||||
into property sets, so that related properties are grouped together.
|
||||
|
||||
If a property is assigned to a type, the property is inherited by all
|
||||
occurrences of that type. For example, a wall type with a FireRating
|
||||
property of "2HR" automatically implies that all walls of that wall type
|
||||
also have a FireRating of "2HR". It is not necessary to explictly define
|
||||
the property again for each occurrence. This also means that properties
|
||||
are typically defined on types. If the same property is defined at an
|
||||
occurrence, this overrides the property defined on the type.
|
||||
If a property is assigned to a type, the property is inherited by all
|
||||
occurrences of that type. For example, a wall type with a FireRating
|
||||
property of "2HR" automatically implies that all walls of that wall type
|
||||
also have a FireRating of "2HR". It is not necessary to explictly define
|
||||
the property again for each occurrence. This also means that properties
|
||||
are typically defined on types. If the same property is defined at an
|
||||
occurrence, this overrides the property defined on the type.
|
||||
|
||||
buildingSMART has come up with a long list of standardised properties
|
||||
for the most common properties required internationally. This solves the
|
||||
age-old question of "where do I store my FireRating data for walls"? The
|
||||
answer, in this case, is in the "FireRating" property with an "IfcLabel"
|
||||
data type grouped in the "Pset_WallCommon" property set. It is
|
||||
recommended to view the list of standardised buildingSMART properties
|
||||
and see if any suit your needs first. If none are appropriate, then you
|
||||
are free to create your own custom properties.
|
||||
buildingSMART has come up with a long list of standardised properties
|
||||
for the most common properties required internationally. This solves the
|
||||
age-old question of "where do I store my FireRating data for walls"? The
|
||||
answer, in this case, is in the "FireRating" property with an "IfcLabel"
|
||||
data type grouped in the "Pset_WallCommon" property set. It is
|
||||
recommended to view the list of standardised buildingSMART properties
|
||||
and see if any suit your needs first. If none are appropriate, then you
|
||||
are free to create your own custom properties.
|
||||
|
||||
This function adds a blank named property set. One you have a property
|
||||
set you may add properties using ifcopenshell.api.pset.edit_pset.
|
||||
This function adds a blank named property set. One you have a property
|
||||
set you may add properties using ifcopenshell.api.pset.edit_pset.
|
||||
|
||||
See also ifcopenshell.api.pset.add_qto if you want to add quantification
|
||||
data, rather than arbitrary metadata.
|
||||
See also ifcopenshell.api.pset.add_qto if you want to add quantification
|
||||
data, rather than arbitrary metadata.
|
||||
|
||||
:param product: The IfcObject that you want to assign a property set to.
|
||||
:type product: ifcopenshell.entity_instance
|
||||
:param name: The name of the property set. Property sets that are
|
||||
standardised by buildingSMART typically have a prefix of "Pset_",
|
||||
like "Pset_WallCommon". If you create your own, you must not use
|
||||
that prefix. It is recommended to use your own prefix tailored to
|
||||
your project, company, or local government requirement.
|
||||
:type name: str
|
||||
:return: The newly created IfcPropertySet
|
||||
:rtype: ifcopenshell.entity_instance
|
||||
:param product: The IfcObject that you want to assign a property set to.
|
||||
:type product: ifcopenshell.entity_instance
|
||||
:param name: The name of the property set. Property sets that are
|
||||
standardised by buildingSMART typically have a prefix of "Pset_",
|
||||
like "Pset_WallCommon". If you create your own, you must not use
|
||||
that prefix. It is recommended to use your own prefix tailored to
|
||||
your project, company, or local government requirement.
|
||||
:type name: str
|
||||
:return: The newly created IfcPropertySet
|
||||
:rtype: ifcopenshell.entity_instance
|
||||
|
||||
Example:
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
.. code:: python
|
||||
|
||||
# Let's imagine we have a new wall type.
|
||||
wall_type = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWallType")
|
||||
# Let's imagine we have a new wall type.
|
||||
wall_type = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWallType")
|
||||
|
||||
# Note that this only creates and assigns an empty property set. We
|
||||
# still need to add properties into the property set. Having blank
|
||||
# property sets are invalid.
|
||||
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Pset_WallCommon")
|
||||
# Note that this only creates and assigns an empty property set. We
|
||||
# still need to add properties into the property set. Having blank
|
||||
# property sets are invalid.
|
||||
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Pset_WallCommon")
|
||||
|
||||
# Add a fire rating property standardised by buildingSMART.
|
||||
ifcopenshell.api.run("pset.edit_pset", model, pset=pset, properties={"FireRating": "2HR"})
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {"product": product, "name": name}
|
||||
# Add a fire rating property standardised by buildingSMART.
|
||||
ifcopenshell.api.run("pset.edit_pset", model, pset=pset, properties={"FireRating": "2HR"})
|
||||
"""
|
||||
settings = {"product": product, "name": name}
|
||||
|
||||
def execute(self):
|
||||
if self.settings["product"].is_a("IfcObject") or self.settings["product"].is_a("IfcContext"):
|
||||
for rel in self.settings["product"].IsDefinedBy or []:
|
||||
if (
|
||||
rel.is_a("IfcRelDefinesByProperties")
|
||||
and rel.RelatingPropertyDefinition.Name == self.settings["name"]
|
||||
):
|
||||
return rel.RelatingPropertyDefinition
|
||||
if settings["product"].is_a("IfcObject") or settings["product"].is_a("IfcContext"):
|
||||
for rel in settings["product"].IsDefinedBy or []:
|
||||
if rel.is_a("IfcRelDefinesByProperties") and rel.RelatingPropertyDefinition.Name == settings["name"]:
|
||||
return rel.RelatingPropertyDefinition
|
||||
|
||||
pset = self.file.create_entity(
|
||||
"IfcPropertySet",
|
||||
**{
|
||||
"GlobalId": ifcopenshell.guid.new(),
|
||||
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
|
||||
"Name": self.settings["name"],
|
||||
}
|
||||
)
|
||||
self.file.create_entity(
|
||||
"IfcRelDefinesByProperties",
|
||||
**{
|
||||
"GlobalId": ifcopenshell.guid.new(),
|
||||
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
|
||||
"RelatedObjects": [self.settings["product"]],
|
||||
"RelatingPropertyDefinition": pset,
|
||||
}
|
||||
)
|
||||
return pset
|
||||
elif self.settings["product"].is_a("IfcTypeObject"):
|
||||
for definition in self.settings["product"].HasPropertySets or []:
|
||||
if definition.Name == self.settings["name"]:
|
||||
return definition
|
||||
pset = file.create_entity(
|
||||
"IfcPropertySet",
|
||||
**{
|
||||
"GlobalId": ifcopenshell.guid.new(),
|
||||
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", file),
|
||||
"Name": settings["name"],
|
||||
}
|
||||
)
|
||||
file.create_entity(
|
||||
"IfcRelDefinesByProperties",
|
||||
**{
|
||||
"GlobalId": ifcopenshell.guid.new(),
|
||||
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", file),
|
||||
"RelatedObjects": [settings["product"]],
|
||||
"RelatingPropertyDefinition": pset,
|
||||
}
|
||||
)
|
||||
return pset
|
||||
elif settings["product"].is_a("IfcTypeObject"):
|
||||
for definition in settings["product"].HasPropertySets or []:
|
||||
if definition.Name == settings["name"]:
|
||||
return definition
|
||||
|
||||
pset = self.file.create_entity(
|
||||
"IfcPropertySet",
|
||||
**{
|
||||
"GlobalId": ifcopenshell.guid.new(),
|
||||
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
|
||||
"Name": self.settings["name"],
|
||||
}
|
||||
)
|
||||
has_property_sets = list(self.settings["product"].HasPropertySets or [])
|
||||
has_property_sets.append(pset)
|
||||
self.settings["product"].HasPropertySets = has_property_sets
|
||||
return pset
|
||||
elif self.settings["product"].is_a("IfcMaterialDefinition"):
|
||||
for definition in self.settings["product"].HasProperties or []:
|
||||
if definition.Name == self.settings["name"]:
|
||||
return definition
|
||||
pset = file.create_entity(
|
||||
"IfcPropertySet",
|
||||
**{
|
||||
"GlobalId": ifcopenshell.guid.new(),
|
||||
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", file),
|
||||
"Name": settings["name"],
|
||||
}
|
||||
)
|
||||
has_property_sets = list(settings["product"].HasPropertySets or [])
|
||||
has_property_sets.append(pset)
|
||||
settings["product"].HasPropertySets = has_property_sets
|
||||
return pset
|
||||
elif settings["product"].is_a("IfcMaterialDefinition"):
|
||||
for definition in settings["product"].HasProperties or []:
|
||||
if definition.Name == settings["name"]:
|
||||
return definition
|
||||
|
||||
return self.file.create_entity(
|
||||
"IfcMaterialProperties",
|
||||
**{
|
||||
"Name": self.settings["name"],
|
||||
"Material": self.settings["product"],
|
||||
}
|
||||
)
|
||||
elif self.settings["product"].is_a("IfcProfileDef"):
|
||||
for definition in self.settings["product"].HasProperties or []:
|
||||
if definition.Name == self.settings["name"]:
|
||||
return definition
|
||||
return file.create_entity(
|
||||
"IfcMaterialProperties",
|
||||
**{
|
||||
"Name": settings["name"],
|
||||
"Material": settings["product"],
|
||||
}
|
||||
)
|
||||
elif settings["product"].is_a("IfcProfileDef"):
|
||||
for definition in settings["product"].HasProperties or []:
|
||||
if definition.Name == settings["name"]:
|
||||
return definition
|
||||
|
||||
return self.file.create_entity(
|
||||
"IfcProfileProperties",
|
||||
**{
|
||||
"Name": self.settings["name"],
|
||||
"ProfileDefinition": self.settings["product"],
|
||||
}
|
||||
)
|
||||
return file.create_entity(
|
||||
"IfcProfileProperties",
|
||||
**{
|
||||
"Name": settings["name"],
|
||||
"ProfileDefinition": settings["product"],
|
||||
}
|
||||
)
|
||||
|
||||
@@ -20,65 +20,68 @@ import ifcopenshell
|
||||
import ifcopenshell.api
|
||||
|
||||
|
||||
def add_qto(file, product=None, name=None) -> None:
|
||||
"""Adds a new quantity set to a product
|
||||
|
||||
Products, such as physical objects or types in IFC may have quantities
|
||||
associated with them. These quantities are typically simple key value
|
||||
metadata with data types. For example, a wall type may have a quantity
|
||||
called NetSideArea with a area value of "4.2". Quantities are grouped
|
||||
into quantity sets, so that related quantities are grouped together.
|
||||
|
||||
Quantities are similar to, but different from properties in that they
|
||||
may store a method of measurement or formula. Quantities may also have
|
||||
parametric relationships to other calculated values, such as cost
|
||||
schedules, resource utilisation, or construction task durations.
|
||||
|
||||
buildingSMART has come up with a long list of standardised quantities
|
||||
for the most common quantities required internationally. This solves the
|
||||
age-old question of "what's the standard way of storing quantity
|
||||
take-off data"? It is recommended to view the list of standardised
|
||||
buildingSMART quantities and see if any suit your needs first. If none
|
||||
are appropriate, then you are free to create your own custom quantities.
|
||||
|
||||
This function adds a blank named quantity set. One you have a quantity
|
||||
set you may add quantities using ifcopenshell.api.pset.edit_qto.
|
||||
|
||||
See also ifcopenshell.api.pset.add_qto if you want to arbitrary
|
||||
metadata, rather than quantification data.
|
||||
|
||||
:param product: The IfcObject that you want to assign a quantity set to.
|
||||
:type product: ifcopenshell.entity_instance
|
||||
:param name: The name of the quantity set. Quantity sets that are
|
||||
standardised by buildingSMART typically have a prefix of "Qto_",
|
||||
like "Qto_WallBaseQuantities". If you create your own, you must not
|
||||
use that prefix. It is recommended to use your own prefix tailored
|
||||
to your project, company, or local government requirement.
|
||||
:type name: str
|
||||
:return: The newly created IfcElementQuantity
|
||||
:rtype: ifcopenshell.entity_instance
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
# Let's imagine we have a new wall.
|
||||
wall = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWall")
|
||||
|
||||
# Note that this only creates and assigns an empty quantity set. We
|
||||
# still need to add quantities into the property set. Having blank
|
||||
# quantity sets are invalid.
|
||||
qto = ifcopenshell.api.run("pset.add_qto", model, product=wall_type, name="Qto_WallBaseQuantities")
|
||||
|
||||
# Add a side area property standardised by buildingSMART. This
|
||||
# allows quantity take-off to occur, even though no geometry has
|
||||
# even been modelled!
|
||||
ifcopenshell.api.run("pset.edit_qto", model, qto=qto, properties={"NetSideArea": 4.2})
|
||||
"""
|
||||
usecase = Usecase()
|
||||
usecase.file = file
|
||||
usecase.settings = {"product": product, "name": name}
|
||||
return usecase.execute()
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, product=None, name=None):
|
||||
"""Adds a new quantity set to a product
|
||||
|
||||
Products, such as physical objects or types in IFC may have quantities
|
||||
associated with them. These quantities are typically simple key value
|
||||
metadata with data types. For example, a wall type may have a quantity
|
||||
called NetSideArea with a area value of "4.2". Quantities are grouped
|
||||
into quantity sets, so that related quantities are grouped together.
|
||||
|
||||
Quantities are similar to, but different from properties in that they
|
||||
may store a method of measurement or formula. Quantities may also have
|
||||
parametric relationships to other calculated values, such as cost
|
||||
schedules, resource utilisation, or construction task durations.
|
||||
|
||||
buildingSMART has come up with a long list of standardised quantities
|
||||
for the most common quantities required internationally. This solves the
|
||||
age-old question of "what's the standard way of storing quantity
|
||||
take-off data"? It is recommended to view the list of standardised
|
||||
buildingSMART quantities and see if any suit your needs first. If none
|
||||
are appropriate, then you are free to create your own custom quantities.
|
||||
|
||||
This function adds a blank named quantity set. One you have a quantity
|
||||
set you may add quantities using ifcopenshell.api.pset.edit_qto.
|
||||
|
||||
See also ifcopenshell.api.pset.add_qto if you want to arbitrary
|
||||
metadata, rather than quantification data.
|
||||
|
||||
:param product: The IfcObject that you want to assign a quantity set to.
|
||||
:type product: ifcopenshell.entity_instance
|
||||
:param name: The name of the quantity set. Quantity sets that are
|
||||
standardised by buildingSMART typically have a prefix of "Qto_",
|
||||
like "Qto_WallBaseQuantities". If you create your own, you must not
|
||||
use that prefix. It is recommended to use your own prefix tailored
|
||||
to your project, company, or local government requirement.
|
||||
:type name: str
|
||||
:return: The newly created IfcElementQuantity
|
||||
:rtype: ifcopenshell.entity_instance
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
# Let's imagine we have a new wall.
|
||||
wall = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWall")
|
||||
|
||||
# Note that this only creates and assigns an empty quantity set. We
|
||||
# still need to add quantities into the property set. Having blank
|
||||
# quantity sets are invalid.
|
||||
qto = ifcopenshell.api.run("pset.add_qto", model, product=wall_type, name="Qto_WallBaseQuantities")
|
||||
|
||||
# Add a side area property standardised by buildingSMART. This
|
||||
# allows quantity take-off to occur, even though no geometry has
|
||||
# even been modelled!
|
||||
ifcopenshell.api.run("pset.edit_qto", model, qto=qto, properties={"NetSideArea": 4.2})
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {"product": product, "name": name}
|
||||
|
||||
def execute(self):
|
||||
if self.settings["product"].is_a("IfcObject") or self.settings["product"].is_a("IfcContext"):
|
||||
for rel in self.settings["product"].IsDefinedBy or []:
|
||||
|
||||
@@ -20,141 +20,144 @@ import ifcopenshell
|
||||
import ifcopenshell.util.pset
|
||||
|
||||
|
||||
def edit_pset(file, pset=None, name=None, properties=None, pset_template=None, should_purge=False) -> None:
|
||||
"""Edits a property set and its properties
|
||||
|
||||
At its simplest usage, this may be used to edit the name of a property
|
||||
set. It may also be used to add, edit, or remove properties, either
|
||||
arbitrarily or using a property set template.
|
||||
|
||||
A list of properties are provided as a dictionary, where the keys are
|
||||
property names, and values are property values. Keys that don't already
|
||||
exist are interpreted as properties to be added. Keys that already exist
|
||||
are interpreted as properties to be edited. A "None" value may specify a
|
||||
property to be deleted.
|
||||
|
||||
Properties must have a data type. There are lots of data types in IFCs,
|
||||
not just simple unitless data types like integers, booleans, text, but
|
||||
also distinguishing between types of text, like labels versus
|
||||
descriptive text. There are also lots of unit-based data types like
|
||||
areas, volumes, lengths, power, density, flow rates, pressure, etc.
|
||||
|
||||
To ensure the appropriate data type is used for properties, a property
|
||||
set template may be used. These can be seen as "property
|
||||
specifications". A default selection is provided by buildingSMART, so
|
||||
that all buildingSMART defined standard properties have exactly the same
|
||||
data types and exactly the right property names without fear of invalid
|
||||
data or typos. The built-in buildingSMART templates are always loaded.
|
||||
However, you may also specify your own templates. If you try to add a
|
||||
non-standard property that does not exist in either your own template or
|
||||
in the built-in buildingSMART template, then you have the responsibility
|
||||
to ensure that data types are always consistent and correct.
|
||||
|
||||
:param pset: The IfcPropertySet to edit.
|
||||
:type pset: ifcopenshell.entity_instance
|
||||
:param name: A new name for the property set. If no name is specified,
|
||||
the property set name is not changed.
|
||||
:type name: str, optional
|
||||
:param properties: A dictionary of properties. The keys must be a string
|
||||
of the name of the property. The data type of the value will be
|
||||
determined by the property set template. If no property set
|
||||
template is found, the data types of the Python values will
|
||||
influence the IFC data type of the property. String values will
|
||||
become IfcLabel, float values will become IfcReal, booleans will
|
||||
become IfcBoolean, and integers will become IfcInteger. If more
|
||||
control is desired, you may explicitly specify IFC data objects
|
||||
directly. Note that provided `properties` might be mutated in the process.
|
||||
:type properties: dict
|
||||
:param pset_template: If a property set template is provided, this will
|
||||
be used to determine data types. If no user-defined template is
|
||||
provided, the built-in buildingSMART templates will be loaded.
|
||||
:type pset_template: ifcopenshell.entity_instance
|
||||
:param should_purge: If left as False, properties set to None will be
|
||||
left as None but not removed. If set to true, properties set to None
|
||||
will actually be removed.
|
||||
:type should_purge: bool, optional
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
# Let's imagine we have a new wall type.
|
||||
wall_type = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWallType")
|
||||
|
||||
# This is a standard buildingSMART property set.
|
||||
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Pset_WallCommon")
|
||||
|
||||
# In this scenario, we don't specify any pset_template because it is
|
||||
# part of the built-in buildingSMART templates, and so the
|
||||
# FireRating will automatically be an IfcLabel, and the thermal
|
||||
# transmittance value will automatically be an
|
||||
# IfcThermalTransmittanceMeasure. Neither of these properties exist
|
||||
# yet, so they will be created.
|
||||
ifcopenshell.api.run("pset.edit_pset", model,
|
||||
pset=pset, properties={"FireRating": "2HR", "ThermalTransmittance": 42.3})
|
||||
|
||||
# We can edit existing properties. In this case, "FireRating" is
|
||||
# edited from "2HR" to "1HR". Combustible is new, and will be added.
|
||||
# The existing "ThermalTransmittance" property will be left
|
||||
# unchanged.
|
||||
ifcopenshell.api.run("pset.edit_pset", model,
|
||||
pset=pset, properties={"FireRating": "1HR", "Combustible": False})
|
||||
|
||||
# Setting to None will change the value but not delete the property.
|
||||
ifcopenshell.api.run("pset.edit_pset", model, pset=pset, properties={"Combustible": None})
|
||||
|
||||
# If you actually want to delete the property, enable purging.
|
||||
ifcopenshell.api.run("pset.edit_pset", model, pset=pset,
|
||||
properties={"Combustible": None}, should_purge=True)
|
||||
|
||||
# What if we wanted to manage our own properties? Let's create our
|
||||
# own "Company Standard" property set templates. Notice how we
|
||||
# prefix our property set with "Foo_", if our company name was "Foo"
|
||||
# this would make sense.
|
||||
template = ifcopenshell.api.run("pset_template.add_pset_template", model, name="Foo_bar")
|
||||
|
||||
# Let's imagine we want all model authors to specify two properties,
|
||||
# one being a length measurement and another being a boolean.
|
||||
prop1 = ifcopenshell.api.run("pset_template.add_prop_template", model,
|
||||
pset_template=template, name="DemoA", primary_measure_type="IfcLengthMeasure")
|
||||
prop2 = ifcopenshell.api.run("pset_template.add_prop_template", model,
|
||||
pset_template=template, name="DemoB", primary_measure_type="IfcBoolean")
|
||||
|
||||
# Now we can use our property set template to add our properties,
|
||||
# and the data types will always match our template.
|
||||
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Foo_Bar")
|
||||
ifcopenshell.api.run("pset.edit_pset", model,
|
||||
pset=pset, properties={"DemoA": 42.3, "DemoB": True}, pset_template=template)
|
||||
|
||||
# Here's a third scenario where we want to add arbitrary properties
|
||||
# that are not standardised by anything, not even our own custom
|
||||
# templates.
|
||||
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Custom_Pset")
|
||||
ifcopenshell.api.run("pset.edit_pset", model,
|
||||
pset=pset, properties={
|
||||
# Basic Python data types are mapped to a sensible default
|
||||
"SomeLabel": "Foo",
|
||||
"SomeNumber": 12.3,
|
||||
# But we can always specify exactly what we're after too
|
||||
"ExplicitLength": model.createIfcLengthMeasure(42.3)
|
||||
})
|
||||
|
||||
# Editing existing properties will retain their current data types
|
||||
# if possible. So this will still be a length measure.
|
||||
ifcopenshell.api.run("pset.edit_pset", model, pset=pset, properties={"ExplicitLength": 12.3})
|
||||
"""
|
||||
usecase = Usecase()
|
||||
usecase.file = file
|
||||
usecase.settings = {
|
||||
"pset": pset,
|
||||
"name": name,
|
||||
"properties": properties or {},
|
||||
"pset_template": pset_template,
|
||||
"should_purge": should_purge,
|
||||
}
|
||||
return usecase.execute()
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, pset=None, name=None, properties=None, pset_template=None, should_purge=False):
|
||||
"""Edits a property set and its properties
|
||||
|
||||
At its simplest usage, this may be used to edit the name of a property
|
||||
set. It may also be used to add, edit, or remove properties, either
|
||||
arbitrarily or using a property set template.
|
||||
|
||||
A list of properties are provided as a dictionary, where the keys are
|
||||
property names, and values are property values. Keys that don't already
|
||||
exist are interpreted as properties to be added. Keys that already exist
|
||||
are interpreted as properties to be edited. A "None" value may specify a
|
||||
property to be deleted.
|
||||
|
||||
Properties must have a data type. There are lots of data types in IFCs,
|
||||
not just simple unitless data types like integers, booleans, text, but
|
||||
also distinguishing between types of text, like labels versus
|
||||
descriptive text. There are also lots of unit-based data types like
|
||||
areas, volumes, lengths, power, density, flow rates, pressure, etc.
|
||||
|
||||
To ensure the appropriate data type is used for properties, a property
|
||||
set template may be used. These can be seen as "property
|
||||
specifications". A default selection is provided by buildingSMART, so
|
||||
that all buildingSMART defined standard properties have exactly the same
|
||||
data types and exactly the right property names without fear of invalid
|
||||
data or typos. The built-in buildingSMART templates are always loaded.
|
||||
However, you may also specify your own templates. If you try to add a
|
||||
non-standard property that does not exist in either your own template or
|
||||
in the built-in buildingSMART template, then you have the responsibility
|
||||
to ensure that data types are always consistent and correct.
|
||||
|
||||
:param pset: The IfcPropertySet to edit.
|
||||
:type pset: ifcopenshell.entity_instance
|
||||
:param name: A new name for the property set. If no name is specified,
|
||||
the property set name is not changed.
|
||||
:type name: str, optional
|
||||
:param properties: A dictionary of properties. The keys must be a string
|
||||
of the name of the property. The data type of the value will be
|
||||
determined by the property set template. If no property set
|
||||
template is found, the data types of the Python values will
|
||||
influence the IFC data type of the property. String values will
|
||||
become IfcLabel, float values will become IfcReal, booleans will
|
||||
become IfcBoolean, and integers will become IfcInteger. If more
|
||||
control is desired, you may explicitly specify IFC data objects
|
||||
directly. Note that provided `properties` might be mutated in the process.
|
||||
:type properties: dict
|
||||
:param pset_template: If a property set template is provided, this will
|
||||
be used to determine data types. If no user-defined template is
|
||||
provided, the built-in buildingSMART templates will be loaded.
|
||||
:type pset_template: ifcopenshell.entity_instance
|
||||
:param should_purge: If left as False, properties set to None will be
|
||||
left as None but not removed. If set to true, properties set to None
|
||||
will actually be removed.
|
||||
:type should_purge: bool, optional
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
# Let's imagine we have a new wall type.
|
||||
wall_type = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWallType")
|
||||
|
||||
# This is a standard buildingSMART property set.
|
||||
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Pset_WallCommon")
|
||||
|
||||
# In this scenario, we don't specify any pset_template because it is
|
||||
# part of the built-in buildingSMART templates, and so the
|
||||
# FireRating will automatically be an IfcLabel, and the thermal
|
||||
# transmittance value will automatically be an
|
||||
# IfcThermalTransmittanceMeasure. Neither of these properties exist
|
||||
# yet, so they will be created.
|
||||
ifcopenshell.api.run("pset.edit_pset", model,
|
||||
pset=pset, properties={"FireRating": "2HR", "ThermalTransmittance": 42.3})
|
||||
|
||||
# We can edit existing properties. In this case, "FireRating" is
|
||||
# edited from "2HR" to "1HR". Combustible is new, and will be added.
|
||||
# The existing "ThermalTransmittance" property will be left
|
||||
# unchanged.
|
||||
ifcopenshell.api.run("pset.edit_pset", model,
|
||||
pset=pset, properties={"FireRating": "1HR", "Combustible": False})
|
||||
|
||||
# Setting to None will change the value but not delete the property.
|
||||
ifcopenshell.api.run("pset.edit_pset", model, pset=pset, properties={"Combustible": None})
|
||||
|
||||
# If you actually want to delete the property, enable purging.
|
||||
ifcopenshell.api.run("pset.edit_pset", model, pset=pset,
|
||||
properties={"Combustible": None}, should_purge=True)
|
||||
|
||||
# What if we wanted to manage our own properties? Let's create our
|
||||
# own "Company Standard" property set templates. Notice how we
|
||||
# prefix our property set with "Foo_", if our company name was "Foo"
|
||||
# this would make sense.
|
||||
template = ifcopenshell.api.run("pset_template.add_pset_template", model, name="Foo_bar")
|
||||
|
||||
# Let's imagine we want all model authors to specify two properties,
|
||||
# one being a length measurement and another being a boolean.
|
||||
prop1 = ifcopenshell.api.run("pset_template.add_prop_template", model,
|
||||
pset_template=template, name="DemoA", primary_measure_type="IfcLengthMeasure")
|
||||
prop2 = ifcopenshell.api.run("pset_template.add_prop_template", model,
|
||||
pset_template=template, name="DemoB", primary_measure_type="IfcBoolean")
|
||||
|
||||
# Now we can use our property set template to add our properties,
|
||||
# and the data types will always match our template.
|
||||
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Foo_Bar")
|
||||
ifcopenshell.api.run("pset.edit_pset", model,
|
||||
pset=pset, properties={"DemoA": 42.3, "DemoB": True}, pset_template=template)
|
||||
|
||||
# Here's a third scenario where we want to add arbitrary properties
|
||||
# that are not standardised by anything, not even our own custom
|
||||
# templates.
|
||||
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Custom_Pset")
|
||||
ifcopenshell.api.run("pset.edit_pset", model,
|
||||
pset=pset, properties={
|
||||
# Basic Python data types are mapped to a sensible default
|
||||
"SomeLabel": "Foo",
|
||||
"SomeNumber": 12.3,
|
||||
# But we can always specify exactly what we're after too
|
||||
"ExplicitLength": model.createIfcLengthMeasure(42.3)
|
||||
})
|
||||
|
||||
# Editing existing properties will retain their current data types
|
||||
# if possible. So this will still be a length measure.
|
||||
ifcopenshell.api.run("pset.edit_pset", model, pset=pset, properties={"ExplicitLength": 12.3})
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {
|
||||
"pset": pset,
|
||||
"name": name,
|
||||
"properties": properties or {},
|
||||
"pset_template": pset_template,
|
||||
"should_purge": should_purge,
|
||||
}
|
||||
|
||||
def execute(self):
|
||||
self.update_pset_name()
|
||||
self.load_pset_template()
|
||||
|
||||
@@ -20,97 +20,100 @@ import ifcopenshell
|
||||
import ifcopenshell.util.pset
|
||||
|
||||
|
||||
def edit_qto(file, qto=None, name=None, properties=None, pset_template=None) -> None:
|
||||
"""Edits a quantity set and its quantities
|
||||
|
||||
At its simplest usage, this may be used to edit the name of a quantity
|
||||
set. It may also be used to add, edit, or remove quantities.
|
||||
|
||||
See ifcopenshell.api.pset.edit_pset for documentation on how this is
|
||||
intended to be used.
|
||||
|
||||
One major difference is that quantities set to None are always purged.
|
||||
It is not allowed to have None quantities in IFC.
|
||||
|
||||
:param qto: The IfcElementQuantity to edit.
|
||||
:type qto: ifcopenshell.entity_instance
|
||||
:param name: A new name for the quantity set. If no name is specified,
|
||||
the quantity set name is not changed.
|
||||
:type name: str, optional
|
||||
:param properties: A dictionary of properties. The keys must be a string
|
||||
of the name of the quantity. The data type of the value will be
|
||||
determined by the quantity set template. If no quantity set
|
||||
template is found, the data types of the Python values will
|
||||
influence the IFC data type of the quantity. String values will
|
||||
become IfcLabel, float values will become IfcReal, booleans will
|
||||
become IfcBoolean, and integers will become IfcInteger. If more
|
||||
control is desired, you may explicitly specify IFC data objects
|
||||
directly.
|
||||
:type properties: dict
|
||||
:param pset_template: If a quantity set template is provided, this will
|
||||
be used to determine data types. If no user-defined template is
|
||||
provided, the built-in buildingSMART templates will be loaded.
|
||||
:type pset_template: ifcopenshell.entity_instance
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
# Let's imagine we have a new wall type.
|
||||
wall = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWall")
|
||||
|
||||
# This is a standard buildingSMART property set.
|
||||
qto = ifcopenshell.api.run("pset.add_qto", model, product=wall, name="Qto_WallBaseQuantities")
|
||||
|
||||
# In this scenario, we don't specify any pset_template because it is
|
||||
# part of the built-in buildingSMART templates, and so the Length
|
||||
# will automatically be an IfcLengthMeasure, and the NetVolume will
|
||||
# automatically be an IfcVolumeMeasure. Neither of these properties
|
||||
# exist yet, so they will be created.
|
||||
ifcopenshell.api.run("pset.edit_qto", model, qto=qto, properties={"Length": 12, "NetVolume": 7.2})
|
||||
|
||||
# Setting to None will delete the quantity.
|
||||
ifcopenshell.api.run("pset.edit_qto", model, qto=qto, properties={"Length": None})
|
||||
|
||||
# What if we wanted to manage our own properties? Let's create our
|
||||
# own "Company Standard" property set templates. Notice how we
|
||||
# prefix our property set with "Foo_", if our company name was "Foo"
|
||||
# this would make sense. In this example, we say that our template
|
||||
# only applies to walls and is for quantities.
|
||||
template = ifcopenshell.api.run("pset_template.add_pset_template", model,
|
||||
name="Foo_Wall", template_type="QTO_OCCURRENCEDRIVEN", applicable_entity="IfcWall")
|
||||
|
||||
# Let's imagine we want all model authors to specify a length
|
||||
# measurement for the portion of a wall that is overhanging.
|
||||
prop = ifcopenshell.api.run("pset_template.add_prop_template", model, pset_template=template,
|
||||
name="OverhangLength", template_type="Q_LENGTH", primary_measure_type="IfcLengthMeasure")
|
||||
|
||||
# Now we can use our property set template to add our properties,
|
||||
# and the data types will always match our template.
|
||||
qto = ifcopenshell.api.run("pset.add_qto", model, product=wall, name="Foo_Wall")
|
||||
ifcopenshell.api.run("pset.edit_qto", model,
|
||||
qto=qto, properties={"OverhangLength": 42.3}, pset_template=template)
|
||||
|
||||
# Here's a third scenario where we want to add arbitrary quantities
|
||||
# that are not standardised by anything, not even our own custom
|
||||
# templates.
|
||||
qto = ifcopenshell.api.run("pset.add_qto", model, product=wall, name="Custom_Qto")
|
||||
ifcopenshell.api.run("pset.edit_qto", model,
|
||||
qto=qto, properties={
|
||||
"SomeLength": model.createIfcLengthMeasure(42.3),
|
||||
"SomeArea": model.createIfcAreaMeasure(21.0)
|
||||
})
|
||||
|
||||
# Editing existing quantities will retain their current data types
|
||||
# if possible. So this will still be a length measure.
|
||||
ifcopenshell.api.run("pset.edit_qto", model, qto=qto, properties={"SomeLength": 12.3})
|
||||
"""
|
||||
usecase = Usecase()
|
||||
usecase.file = file
|
||||
usecase.settings = {"qto": qto, "name": name, "properties": properties or {}, "pset_template": pset_template}
|
||||
return usecase.execute()
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, qto=None, name=None, properties=None, pset_template=None):
|
||||
"""Edits a quantity set and its quantities
|
||||
|
||||
At its simplest usage, this may be used to edit the name of a quantity
|
||||
set. It may also be used to add, edit, or remove quantities.
|
||||
|
||||
See ifcopenshell.api.pset.edit_pset for documentation on how this is
|
||||
intended to be used.
|
||||
|
||||
One major difference is that quantities set to None are always purged.
|
||||
It is not allowed to have None quantities in IFC.
|
||||
|
||||
:param qto: The IfcElementQuantity to edit.
|
||||
:type qto: ifcopenshell.entity_instance
|
||||
:param name: A new name for the quantity set. If no name is specified,
|
||||
the quantity set name is not changed.
|
||||
:type name: str, optional
|
||||
:param properties: A dictionary of properties. The keys must be a string
|
||||
of the name of the quantity. The data type of the value will be
|
||||
determined by the quantity set template. If no quantity set
|
||||
template is found, the data types of the Python values will
|
||||
influence the IFC data type of the quantity. String values will
|
||||
become IfcLabel, float values will become IfcReal, booleans will
|
||||
become IfcBoolean, and integers will become IfcInteger. If more
|
||||
control is desired, you may explicitly specify IFC data objects
|
||||
directly.
|
||||
:type properties: dict
|
||||
:param pset_template: If a quantity set template is provided, this will
|
||||
be used to determine data types. If no user-defined template is
|
||||
provided, the built-in buildingSMART templates will be loaded.
|
||||
:type pset_template: ifcopenshell.entity_instance
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
# Let's imagine we have a new wall type.
|
||||
wall = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWall")
|
||||
|
||||
# This is a standard buildingSMART property set.
|
||||
qto = ifcopenshell.api.run("pset.add_qto", model, product=wall, name="Qto_WallBaseQuantities")
|
||||
|
||||
# In this scenario, we don't specify any pset_template because it is
|
||||
# part of the built-in buildingSMART templates, and so the Length
|
||||
# will automatically be an IfcLengthMeasure, and the NetVolume will
|
||||
# automatically be an IfcVolumeMeasure. Neither of these properties
|
||||
# exist yet, so they will be created.
|
||||
ifcopenshell.api.run("pset.edit_qto", model, qto=qto, properties={"Length": 12, "NetVolume": 7.2})
|
||||
|
||||
# Setting to None will delete the quantity.
|
||||
ifcopenshell.api.run("pset.edit_qto", model, qto=qto, properties={"Length": None})
|
||||
|
||||
# What if we wanted to manage our own properties? Let's create our
|
||||
# own "Company Standard" property set templates. Notice how we
|
||||
# prefix our property set with "Foo_", if our company name was "Foo"
|
||||
# this would make sense. In this example, we say that our template
|
||||
# only applies to walls and is for quantities.
|
||||
template = ifcopenshell.api.run("pset_template.add_pset_template", model,
|
||||
name="Foo_Wall", template_type="QTO_OCCURRENCEDRIVEN", applicable_entity="IfcWall")
|
||||
|
||||
# Let's imagine we want all model authors to specify a length
|
||||
# measurement for the portion of a wall that is overhanging.
|
||||
prop = ifcopenshell.api.run("pset_template.add_prop_template", model, pset_template=template,
|
||||
name="OverhangLength", template_type="Q_LENGTH", primary_measure_type="IfcLengthMeasure")
|
||||
|
||||
# Now we can use our property set template to add our properties,
|
||||
# and the data types will always match our template.
|
||||
qto = ifcopenshell.api.run("pset.add_qto", model, product=wall, name="Foo_Wall")
|
||||
ifcopenshell.api.run("pset.edit_qto", model,
|
||||
qto=qto, properties={"OverhangLength": 42.3}, pset_template=template)
|
||||
|
||||
# Here's a third scenario where we want to add arbitrary quantities
|
||||
# that are not standardised by anything, not even our own custom
|
||||
# templates.
|
||||
qto = ifcopenshell.api.run("pset.add_qto", model, product=wall, name="Custom_Qto")
|
||||
ifcopenshell.api.run("pset.edit_qto", model,
|
||||
qto=qto, properties={
|
||||
"SomeLength": model.createIfcLengthMeasure(42.3),
|
||||
"SomeArea": model.createIfcAreaMeasure(21.0)
|
||||
})
|
||||
|
||||
# Editing existing quantities will retain their current data types
|
||||
# if possible. So this will still be a length measure.
|
||||
ifcopenshell.api.run("pset.edit_qto", model, qto=qto, properties={"SomeLength": 12.3})
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {"qto": qto, "name": name, "properties": properties or {}, "pset_template": pset_template}
|
||||
|
||||
def execute(self):
|
||||
self.qto_idx = 5
|
||||
if self.settings["qto"].is_a("IfcPhysicalComplexQuantity"):
|
||||
|
||||
@@ -20,68 +20,65 @@ import ifcopenshell
|
||||
import ifcopenshell.util.element
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, product=None, pset=None):
|
||||
"""Removes a property set from a product
|
||||
def remove_pset(file, product=None, pset=None) -> None:
|
||||
"""Removes a property set from a product
|
||||
|
||||
All properties that are part of this property set are also removed.
|
||||
All properties that are part of this property set are also removed.
|
||||
|
||||
:param product: The IfcObject to remove the property set from.
|
||||
:type product: ifcopenshell.entity_instance
|
||||
:param pset: The IfcPropertySet or IfcElementQuantity to remove.
|
||||
:type pset: ifcopenshell.entity_instance
|
||||
:return: None
|
||||
:rtype: None
|
||||
:param product: The IfcObject to remove the property set from.
|
||||
:type product: ifcopenshell.entity_instance
|
||||
:param pset: The IfcPropertySet or IfcElementQuantity to remove.
|
||||
:type pset: ifcopenshell.entity_instance
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
||||
Example:
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
.. code:: python
|
||||
|
||||
# Let's imagine we have a new wall type with a property set.
|
||||
wall_type = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWallType")
|
||||
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Pset_WallCommon")
|
||||
# Let's imagine we have a new wall type with a property set.
|
||||
wall_type = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWallType")
|
||||
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Pset_WallCommon")
|
||||
|
||||
# Remove it!
|
||||
ifcopenshell.api.run("pset.remove_pset", model, product=wall_type, pset=pset)
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {"product": product, "pset": pset}
|
||||
# Remove it!
|
||||
ifcopenshell.api.run("pset.remove_pset", model, product=wall_type, pset=pset)
|
||||
"""
|
||||
settings = {"product": product, "pset": pset}
|
||||
|
||||
def execute(self):
|
||||
to_purge = []
|
||||
should_remove_pset = True
|
||||
for inverse in self.file.get_inverse(self.settings["pset"]):
|
||||
if inverse.is_a("IfcRelDefinesByProperties"):
|
||||
if not inverse.RelatedObjects or len(inverse.RelatedObjects) == 1:
|
||||
to_purge.append(inverse)
|
||||
else:
|
||||
related_objects = list(inverse.RelatedObjects)
|
||||
related_objects.remove(self.settings["product"])
|
||||
inverse.RelatedObjects = related_objects
|
||||
should_remove_pset = False
|
||||
if should_remove_pset:
|
||||
properties = [] # Predefined psets have no properties
|
||||
if self.settings["pset"].is_a("IfcPropertySet"):
|
||||
properties = self.settings["pset"].HasProperties or []
|
||||
elif self.settings["pset"].is_a("IfcQuantitySet"):
|
||||
properties = self.settings["pset"].Quantities or []
|
||||
elif self.settings["pset"].is_a() in ("IfcMaterialProperties", "IfcProfileProperties"):
|
||||
properties = self.settings["pset"].Properties or []
|
||||
for prop in properties:
|
||||
if self.file.get_total_inverses(prop) != 1:
|
||||
continue
|
||||
if prop.is_a("IfcPropertyEnumeratedValue"):
|
||||
enumeration = prop.EnumerationReference
|
||||
if enumeration and self.file.get_total_inverses(enumeration) == 1:
|
||||
self.file.remove(enumeration)
|
||||
self.file.remove(prop)
|
||||
# IfcMaterialProperties and IfcProfileProperties don't have OwnerHistory
|
||||
history = getattr(self.settings["pset"], "OwnerHistory", None)
|
||||
self.file.remove(self.settings["pset"])
|
||||
if history:
|
||||
ifcopenshell.util.element.remove_deep2(self.file, history)
|
||||
for element in to_purge:
|
||||
history = getattr(element, "OwnerHistory", None)
|
||||
self.file.remove(element)
|
||||
if history:
|
||||
ifcopenshell.util.element.remove_deep2(self.file, history)
|
||||
to_purge = []
|
||||
should_remove_pset = True
|
||||
for inverse in file.get_inverse(settings["pset"]):
|
||||
if inverse.is_a("IfcRelDefinesByProperties"):
|
||||
if not inverse.RelatedObjects or len(inverse.RelatedObjects) == 1:
|
||||
to_purge.append(inverse)
|
||||
else:
|
||||
related_objects = list(inverse.RelatedObjects)
|
||||
related_objects.remove(settings["product"])
|
||||
inverse.RelatedObjects = related_objects
|
||||
should_remove_pset = False
|
||||
if should_remove_pset:
|
||||
properties = [] # Predefined psets have no properties
|
||||
if settings["pset"].is_a("IfcPropertySet"):
|
||||
properties = settings["pset"].HasProperties or []
|
||||
elif settings["pset"].is_a("IfcQuantitySet"):
|
||||
properties = settings["pset"].Quantities or []
|
||||
elif settings["pset"].is_a() in ("IfcMaterialProperties", "IfcProfileProperties"):
|
||||
properties = settings["pset"].Properties or []
|
||||
for prop in properties:
|
||||
if file.get_total_inverses(prop) != 1:
|
||||
continue
|
||||
if prop.is_a("IfcPropertyEnumeratedValue"):
|
||||
enumeration = prop.EnumerationReference
|
||||
if enumeration and file.get_total_inverses(enumeration) == 1:
|
||||
file.remove(enumeration)
|
||||
file.remove(prop)
|
||||
# IfcMaterialProperties and IfcProfileProperties don't have OwnerHistory
|
||||
history = getattr(settings["pset"], "OwnerHistory", None)
|
||||
file.remove(settings["pset"])
|
||||
if history:
|
||||
ifcopenshell.util.element.remove_deep2(file, history)
|
||||
for element in to_purge:
|
||||
history = getattr(element, "OwnerHistory", None)
|
||||
file.remove(element)
|
||||
if history:
|
||||
ifcopenshell.util.element.remove_deep2(file, history)
|
||||
|
||||
Reference in New Issue
Block a user