mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 14:22:33 +00:00
Minor fix
This commit is contained in:
@@ -369,7 +369,17 @@ class Ods(Json):
|
|||||||
continue
|
continue
|
||||||
table = Table(name=specification["name"])
|
table = Table(name=specification["name"])
|
||||||
tr = TableRow()
|
tr = TableRow()
|
||||||
for header in ["Requirement", "Problem", "Class", "PredefinedType", "Name", "Description", "GlobalId", "Tag", "Element"]:
|
for header in [
|
||||||
|
"Requirement",
|
||||||
|
"Problem",
|
||||||
|
"Class",
|
||||||
|
"PredefinedType",
|
||||||
|
"Name",
|
||||||
|
"Description",
|
||||||
|
"GlobalId",
|
||||||
|
"Tag",
|
||||||
|
"Element",
|
||||||
|
]:
|
||||||
tc = TableCell(valuetype="string", stylename="h")
|
tc = TableCell(valuetype="string", stylename="h")
|
||||||
tc.addElement(P(text=header))
|
tc.addElement(P(text=header))
|
||||||
tr.addElement(tc)
|
tr.addElement(tc)
|
||||||
@@ -423,16 +433,21 @@ class Bcf(Json):
|
|||||||
continue
|
continue
|
||||||
for failure in requirement["failed_entities"]:
|
for failure in requirement["failed_entities"]:
|
||||||
element = failure["element"]
|
element = failure["element"]
|
||||||
title = f"{element.is_a()}/"
|
title_components = [
|
||||||
title += getattr(element, "Name", None) or "Unnamed"
|
element.is_a(),
|
||||||
title += " - " + failure.get("reason", "No reason")
|
getattr(element, "Name", None) or "Unnamed",
|
||||||
|
failure.get("reason", "No reason"),
|
||||||
|
getattr(element, "GlobalId", ""),
|
||||||
|
getattr(element, "Tag", ""),
|
||||||
|
]
|
||||||
|
title = " - ".join(title_components)
|
||||||
description = f'{specification["name"]} - {requirement["description"]}'
|
description = f'{specification["name"]} - {requirement["description"]}'
|
||||||
topic = bcfxml.add_topic(title, description, "IfcTester")
|
topic = bcfxml.add_topic(title, description, "IfcTester")
|
||||||
if getattr(element, "ObjectPlacement", None):
|
if getattr(element, "ObjectPlacement", None):
|
||||||
placement = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement)
|
placement = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement)
|
||||||
if unit_scale is None:
|
if unit_scale is None:
|
||||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(element.wrapped_data.file)
|
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(element.wrapped_data.file)
|
||||||
location = [(o * unit_scale) + 5. for o in placement[:,3][:3]]
|
location = [(o * unit_scale) + 5.0 for o in placement[:, 3][:3]]
|
||||||
viewpoint = topic.add_viewpoint_from_point_and_guids(np.array(location), element.GlobalId)
|
viewpoint = topic.add_viewpoint_from_point_and_guids(np.array(location), element.GlobalId)
|
||||||
if element.is_a("IfcElement"):
|
if element.is_a("IfcElement"):
|
||||||
topic.add_viewpoint(element)
|
topic.add_viewpoint(element)
|
||||||
|
|||||||
Reference in New Issue
Block a user