TechDrawGui API: Difference between revisions

From FreeCAD Documentation
({{TechDraw Tools navi}})
(These functions are part of the TechDraw Workbench and can be used in macros and from the Python console once the TechDrawGui module has been imported.)
Line 3: Line 3:
<!--T:1-->
<!--T:1-->
{{VeryImportantMessage|(November 2018) This information may be incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation].}}
{{VeryImportantMessage|(November 2018) This information may be incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation].}}
These functions are part of the [[TechDraw Workbench]] and can be used in scripts and macros or from the [[Python]] interpreter, once the <code>TechDrawGui</code> module has been imported.
These functions are part of the [[TechDraw Workbench]] and can be used in [[macros]] and from the [[Python]] console once the {{incode|TechDrawGui}} module has been imported.


<!--T:5-->
<!--T:5-->

Revision as of 22:49, 24 November 2018

(November 2018) This information may be incomplete and outdated. For the latest API, see the autogenerated API documentation.

These functions are part of the TechDraw Workbench and can be used in macros and from the Python console once the TechDrawGui module has been imported.

See the TechDraw API for more functions.

Example:

import FreeCAD
import TechDrawGui

p = FreeCAD.ActiveDocument.Page

f = "/home/localuser/myPdfDirectory/savePage.pdf"
TechDrawGui.exportPageAsPdf(p, f)

f = "/home/localuser/mySvgDirectory/savePage.svg"
TechDrawGui.exportPageAsSvg(p, f)
exportPageAsPdf(pageObject, filePath)

Description: save a copy of pageObject in PDF format to location filePath

Returns: none

exportPageAsSvg(pageObject, filePath)

Description: save a copy of pageObject in SVG format to location filePath

Returns: none