mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 22:43:41 +00:00
Black
This commit is contained in:
@@ -167,7 +167,9 @@ class BIMModelProperties(PropertyGroup):
|
|||||||
rl2: bpy.props.FloatProperty(name="RL", default=1, subtype="DISTANCE", description="Z offset for windows")
|
rl2: bpy.props.FloatProperty(name="RL", default=1, subtype="DISTANCE", description="Z offset for windows")
|
||||||
# Used for plan calculation points such as in room generation
|
# Used for plan calculation points such as in room generation
|
||||||
rl3: bpy.props.FloatProperty(name="RL", default=1, subtype="DISTANCE", description="Z offset for space calculation")
|
rl3: bpy.props.FloatProperty(name="RL", default=1, subtype="DISTANCE", description="Z offset for space calculation")
|
||||||
x_angle: bpy.props.FloatProperty(name="X Angle", default=0, subtype="ANGLE", min=math.radians(-180), max=math.radians(180), update=update_x_angle)
|
x_angle: bpy.props.FloatProperty(
|
||||||
|
name="X Angle", default=0, subtype="ANGLE", min=math.radians(-180), max=math.radians(180), update=update_x_angle
|
||||||
|
)
|
||||||
type_page: bpy.props.IntProperty(name="Type Page", default=1, update=update_type_page)
|
type_page: bpy.props.IntProperty(name="Type Page", default=1, update=update_type_page)
|
||||||
type_name: bpy.props.StringProperty(name="Name", default="TYPEX")
|
type_name: bpy.props.StringProperty(name="Name", default="TYPEX")
|
||||||
boundary_class: bpy.props.EnumProperty(items=get_boundary_class, name="Boundary Class")
|
boundary_class: bpy.props.EnumProperty(items=get_boundary_class, name="Boundary Class")
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ import ifcopenshell.util.unit
|
|||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
|
|
||||||
|
|
||||||
def add_derived_unit(file: ifcopenshell.file, unit_type: str, userdefinedtype : str, attributes: dict[ifcopenshell.entity_instance, int]) -> ifcopenshell.entity_instance:
|
def add_derived_unit(
|
||||||
|
file: ifcopenshell.file, unit_type: str, userdefinedtype: str, attributes: dict[ifcopenshell.entity_instance, int]
|
||||||
|
) -> ifcopenshell.entity_instance:
|
||||||
"""Add a new Derive unit
|
"""Add a new Derive unit
|
||||||
|
|
||||||
The supported types are ANGULARVELOCITYUNIT, AREADENSITYUNIT, COMPOUNDPLANEANGLEUNIT,
|
The supported types are ANGULARVELOCITYUNIT, AREADENSITYUNIT, COMPOUNDPLANEANGLEUNIT,
|
||||||
@@ -68,13 +70,14 @@ def add_derived_unit(file: ifcopenshell.file, unit_type: str, userdefinedtype :
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
settings = {"unit_type": unit_type, "attributes": attributes}
|
settings = {"unit_type": unit_type, "attributes": attributes}
|
||||||
|
|
||||||
derive_unit_elements = []
|
derive_unit_elements = []
|
||||||
|
|
||||||
for named_unit in settings['attributes']:
|
for named_unit in settings["attributes"]:
|
||||||
derive_unit_elements.append(file.create_entity("IfcDerivedUnitElement", Unit=named_unit, Exponent = settings['attributes'][named_unit]))
|
derive_unit_elements.append(
|
||||||
|
file.create_entity("IfcDerivedUnitElement", Unit=named_unit, Exponent=settings["attributes"][named_unit])
|
||||||
return file.create_entity("IfcDerivedUnit",
|
)
|
||||||
Elements = derive_unit_elements,
|
|
||||||
UnitType=settings["unit_type"],
|
return file.create_entity(
|
||||||
UserDefinedType=userdefinedtype)
|
"IfcDerivedUnit", Elements=derive_unit_elements, UnitType=settings["unit_type"], UserDefinedType=userdefinedtype
|
||||||
|
)
|
||||||
|
|||||||
@@ -998,8 +998,17 @@ class Restriction:
|
|||||||
for constraint, value in self.options.items():
|
for constraint, value in self.options.items():
|
||||||
value = [value] if not isinstance(value, list) else value
|
value = [value] if not isinstance(value, list) else value
|
||||||
for v in value:
|
for v in value:
|
||||||
if constraint in ["length", "minLength", "maxLength", "maxExclusive", "maxInclusive",
|
if constraint in [
|
||||||
"minExclusive", "minInclusive", "totalDigits", "fractionDigits"]:
|
"length",
|
||||||
|
"minLength",
|
||||||
|
"maxLength",
|
||||||
|
"maxExclusive",
|
||||||
|
"maxInclusive",
|
||||||
|
"minExclusive",
|
||||||
|
"minInclusive",
|
||||||
|
"totalDigits",
|
||||||
|
"fractionDigits",
|
||||||
|
]:
|
||||||
value_dict = {"@value": v}
|
value_dict = {"@value": v}
|
||||||
else:
|
else:
|
||||||
value_dict = {"@value": str(v)}
|
value_dict = {"@value": str(v)}
|
||||||
|
|||||||
Reference in New Issue
Block a user