mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Support material layer set usage negative direction sense for parametric walls
This commit is contained in:
@@ -188,14 +188,17 @@ class AuthoringData:
|
||||
if not ifc_class and ifc_classes:
|
||||
ifc_class = ifc_classes[0][0]
|
||||
if ifc_class:
|
||||
elements = sorted(tool.Ifc.get().by_type(ifc_class), key=lambda s: s.Name)
|
||||
elements = sorted(tool.Ifc.get().by_type(ifc_class), key=lambda s: s.Name or "Unnamed")
|
||||
results.extend(elements)
|
||||
return results
|
||||
return []
|
||||
|
||||
@classmethod
|
||||
def relating_types(cls, ifc_class=None):
|
||||
return [(str(e.id()), e.Name, e.Description or "") for e in cls.constr_class_entities(ifc_class=ifc_class)]
|
||||
return [
|
||||
(str(e.id()), e.Name or "Unnamed", e.Description or "")
|
||||
for e in cls.constr_class_entities(ifc_class=ifc_class)
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def relating_types_browser(cls):
|
||||
@@ -331,7 +334,7 @@ class ArrayData:
|
||||
@classmethod
|
||||
def load(cls):
|
||||
cls.is_loaded = True
|
||||
cls.data = { "parameters": cls.parameters() }
|
||||
cls.data = {"parameters": cls.parameters()}
|
||||
|
||||
@classmethod
|
||||
def parameters(cls):
|
||||
|
||||
@@ -92,14 +92,19 @@ class Model(blenderbim.core.tool.Model):
|
||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||
offset = 0.0
|
||||
thickness = 0.0
|
||||
direction_sense = "POSITIVE"
|
||||
material = ifcopenshell.util.element.get_material(element)
|
||||
if material:
|
||||
if material.is_a("IfcMaterialLayerSetUsage"):
|
||||
offset = material.OffsetFromReferenceLine * unit_scale
|
||||
direction_sense = material.DirectionSense
|
||||
material = material.ForLayerSet
|
||||
if material.is_a("IfcMaterialLayerSet"):
|
||||
thickness = sum([l.LayerThickness for l in material.MaterialLayers]) * unit_scale
|
||||
return {"thickness": thickness, "offset": offset}
|
||||
if direction_sense == "NEGATIVE":
|
||||
thickness *= -1
|
||||
offset *= -1
|
||||
return {"thickness": thickness, "offset": offset, "direction_sense": direction_sense}
|
||||
|
||||
@classmethod
|
||||
def get_manual_booleans(cls, element):
|
||||
|
||||
Reference in New Issue
Block a user