diff --git a/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A1.svg b/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A1.svg index ec48691774..7907be0d93 100644 --- a/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A1.svg +++ b/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A1.svg @@ -1,15 +1,15 @@ + width="841mm" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> image/svg+xml - @@ -44,146 +43,10 @@ width="3027.1016" id="rect116616" style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.88976377;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - REV. NO. - - - - - - - - - - - - - - - DESCRIPTION - AUTHOR - DATE - DRAWING NUMBER - REV - {{Revision}} - {{Identification}} - {{Name}} + + + + + DRAWING NUMBER + REV + {{Revision}} + {{Identification}} + + DRAWING TITLE + {{Name}} + + GRID NORTH + COMPANY + + + + + + + + + + + + REV. NO. + + + + + + + + + + + + DESCRIPTION + AUTHOR + ISSUED + NOTES + DO NOT SCALE DRAWINGS + + DATE + diff --git a/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A2.svg b/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A2.svg index b247c6b86a..4564a4a936 100644 --- a/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A2.svg +++ b/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A2.svg @@ -1,15 +1,15 @@ + viewBox="0 0 594 420" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> image/svg+xml - @@ -40,146 +39,10 @@ width="553.5" id="rect116616" style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.499999;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - REV. NO. - - - - - - - - - - - - DESCRIPTION - AUTHOR - DATE - - - - DRAWING NUMBER - REV - {{Revision}} - {{Identification}} - {{Name}} + + + + + DRAWING NUMBER + REV + {{Revision}} + {{Identification}} + + DRAWING TITLE + {{Name}} + + GRID NORTH + COMPANY + + + + + + + + + + + + REV. NO. + + + + + + + + + + + + DESCRIPTION + AUTHOR + ISSUED + NOTES + DO NOT SCALE DRAWINGS + + DATE + diff --git a/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A3.svg b/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A3.svg index 5cf83f9a92..2602df9b28 100644 --- a/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A3.svg +++ b/src/blenderbim/blenderbim/bim/data/templates/titleblocks/A3.svg @@ -1,15 +1,15 @@ + viewBox="0 0 420 297" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> image/svg+xml - @@ -40,150 +39,10 @@ width="399.5" id="rect116616" style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.49999897;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - REV. NO. - - - - - - - - - - - - DESCRIPTION - AUTHOR - DATE - - - - - DRAWING NUMBER - REV - {{Revision}} - {{Identification}} - {{Name}} - + + + + REV. NO. + + + + + + + + + + + + DESCRIPTION + AUTHOR + ISSUED + NOTES + DO NOT SCALE DRAWINGS + + DATE + + + + + + DRAWING NUMBER + REV + {{Revision}} + {{Identification}} + + DRAWING TITLE + {{Name}} + + GRID NORTH + COMPANY + + + + + + + + + + diff --git a/src/blenderbim/blenderbim/bim/module/drawing/sheeter.py b/src/blenderbim/blenderbim/bim/module/drawing/sheeter.py index 6df58e8199..cee3b179d1 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/sheeter.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/sheeter.py @@ -23,6 +23,7 @@ import pystache import urllib.parse import xml.etree.ElementTree as ET import blenderbim.tool as tool +import ifcopenshell.util.geolocation from shutil import copy from xml.dom import minidom @@ -196,7 +197,14 @@ class SheetBuilder: def build_titleblock(self, root, sheet): titleblock = root.findall('{http://www.w3.org/2000/svg}g[@data-type="titleblock"]')[0] image = titleblock.findall("{http://www.w3.org/2000/svg}image")[0] - titleblock.append(self.parse_embedded_svg(image, sheet.get_info())) + g = self.parse_embedded_svg(image, sheet.get_info()) + grid_north = ifcopenshell.util.geolocation.get_grid_north(tool.Ifc.get()) * -1 + true_north = ifcopenshell.util.geolocation.get_true_north(tool.Ifc.get()) * -1 + for north in g.iterfind('.//{http://www.w3.org/2000/svg}g[@data-type="grid-north"]'): + north.attrib["transform"] = f"rotate({grid_north})" + for north in g.iterfind('.//{http://www.w3.org/2000/svg}g[@data-type="true-north"]'): + north.attrib["transform"] = f"rotate({true_north})" + titleblock.append(g) titleblock.remove(image) def build_drawings(self, root, sheet):