mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
Fix #3752. Accommodate situations where layouts don't match IFC.
This commit is contained in:
@@ -345,8 +345,12 @@ class SheetBuilder:
|
|||||||
def build_drawings(self, root, sheet):
|
def build_drawings(self, root, sheet):
|
||||||
for view in root.findall('{http://www.w3.org/2000/svg}g[@data-type="drawing"]'):
|
for view in root.findall('{http://www.w3.org/2000/svg}g[@data-type="drawing"]'):
|
||||||
drawing_id = int(view.attrib["data-id"])
|
drawing_id = int(view.attrib["data-id"])
|
||||||
reference = tool.Ifc.get().by_id(int(view.attrib["data-id"]))
|
try:
|
||||||
drawing = tool.Ifc.get().by_id(view.attrib["data-drawing"])
|
reference = tool.Ifc.get().by_id(int(view.attrib["data-id"]))
|
||||||
|
drawing = tool.Ifc.get().by_id(view.attrib["data-drawing"])
|
||||||
|
except:
|
||||||
|
# Perhaps the SVG has outdated content or is edited externally which we cannot control.
|
||||||
|
continue
|
||||||
|
|
||||||
images = view.findall("{http://www.w3.org/2000/svg}image")
|
images = view.findall("{http://www.w3.org/2000/svg}image")
|
||||||
|
|
||||||
@@ -387,8 +391,12 @@ class SheetBuilder:
|
|||||||
|
|
||||||
def build_schedules(self, root, sheet):
|
def build_schedules(self, root, sheet):
|
||||||
for view in root.findall('{http://www.w3.org/2000/svg}g[@data-type="schedule"]'):
|
for view in root.findall('{http://www.w3.org/2000/svg}g[@data-type="schedule"]'):
|
||||||
reference = tool.Ifc.get().by_id(int(view.attrib["data-id"]))
|
try:
|
||||||
schedule = tool.Ifc.get().by_id(int(view.attrib["data-schedule"]))
|
reference = tool.Ifc.get().by_id(int(view.attrib["data-id"]))
|
||||||
|
schedule = tool.Ifc.get().by_id(int(view.attrib["data-schedule"]))
|
||||||
|
except:
|
||||||
|
# Perhaps the SVG has outdated content or is edited externally which we cannot control.
|
||||||
|
continue
|
||||||
|
|
||||||
images = view.findall("{http://www.w3.org/2000/svg}image")
|
images = view.findall("{http://www.w3.org/2000/svg}image")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user