TechDrawGui API/de: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 30: Line 30:
* border - float - empty space around image
* border - float - empty space around image
* mode - int - rendering mode (AS_IS, WIREFRAME, POINTS, WIREFRAME_OVERLAY, HIDDEN_LINE, BOUNDING_BOX)
* mode - int - rendering mode (AS_IS, WIREFRAME, POINTS, WIREFRAME_OVERLAY, HIDDEN_LINE, BOUNDING_BOX)
<!--T:6-->
{{TechDraw Tools navi}}


{{TechDraw Tools navi/de}}
<!--T:4-->
[[Category:API]]


[[Category:API/de]]
[[Category:Poweruser Documentation/de]]


[[Category:Poweruser Documentation]]


[[Category:Poweruser Documentation]]
{{clear}}
{{clear}}

Revision as of 10:06, 10 September 2019

(November 2018) Diese Information kann unvollständig und veraltet sein. Für die letzte API siehe die (engl.) autogenerierte API-Dokumentation.

Diese Funktionen sind Teil des TechDraw-Arbeitsbereichs und können in Makros oder mit dem Python-Interpreter verwendet werden, sobald das TechDrawGui importiert wurde.

Siehe die TechDraw-API für weitere Funktionen.

Beispiel:

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

copyActiveViewToSvgFile(document, filePath, (options))

Description: save a copy of the active view for "document" to file "filePath"

Returns: double (estimated scale)

Options:

  • width - float - width of generated svg in mm
  • height - float - height of generated svg in mm
  • paintBackground - bool - paint/do not paint background
  • backgroundColor - tuple - (r,g,b,a)
  • lineWidth - float - weight of lines
  • border - float - empty space around image
  • mode - int - rendering mode (AS_IS, WIREFRAME, POINTS, WIREFRAME_OVERLAY, HIDDEN_LINE, BOUNDING_BOX)