[TechDraw] Make annotation test a unittest
This commit is contained in:
committed by
WandererFan
parent
64f6249ee9
commit
a9a31ad3b8
19
src/Mod/TechDraw/TDTest/TechDrawTestUtilities.py
Normal file
19
src/Mod/TechDraw/TDTest/TechDrawTestUtilities.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from __future__ import print_function
|
||||
import FreeCAD
|
||||
import os
|
||||
|
||||
|
||||
def createPageWithSVGTemplate(
|
||||
templateName: str = "TestTemplate.svg",
|
||||
):
|
||||
"""Returns a page with an SVGTemplate added on the ActiveDocument"""
|
||||
print("2")
|
||||
path = os.path.dirname(os.path.abspath(__file__))
|
||||
print("TDTestAnno path: " + path)
|
||||
templateFileSpec = path + templateName
|
||||
|
||||
page = FreeCAD.ActiveDocument.addObject("TechDraw::DrawPage", "Page")
|
||||
FreeCAD.ActiveDocument.addObject("TechDraw::DrawSVGTemplate", "Template")
|
||||
FreeCAD.ActiveDocument.Template.Template = templateFileSpec
|
||||
FreeCAD.ActiveDocument.Page.Template = FreeCAD.ActiveDocument.Template
|
||||
return page
|
||||
Reference in New Issue
Block a user