TechDrawGui API/de: Difference between revisions

From FreeCAD Documentation
(Created page with "{{APIFunction|exportPageAsPdf|pageObject, filePath|eine Kopie des pageObject im PDF-Format speichern nach location filePath|none}} {{APIFunction|exportPageAsSvg|pageObject, f...")
Line 19: Line 19:
}}
}}


{{APIFunction|exportPageAsPdf|pageObject, filePath|save a copy of pageObject in PDF format to location filePath|none}}
{{APIFunction|exportPageAsPdf|pageObject, filePath|eine Kopie des pageObject im PDF-Format speichern nach location filePath|none}}
{{APIFunction|exportPageAsSvg|pageObject, filePath|save a copy of pageObject in SVG format to location filePath|none}}
{{APIFunction|exportPageAsSvg|pageObject, filePath|eine Kopie des pageObject im SVG-Format speichern nach location filePath|none}}
{{APIFunction|copyActiveViewToSvgFile|document, filePath, (options)|save a copy of the active view for "document" to file "filePath"|double (estimated scale)}}
{{APIFunction|copyActiveViewToSvgFile|document, filePath, (options)|eine Kopie der aktuellen Ansicht als "Dokument" speichern in die Datei "filePath"|double (estimated scale)}}
Optionen:
Options:
* width - float - width of generated svg in mm
* width - float - width des erzeugten SVG in mm
* height - float - height of generated svg in mm
* height - float - height des erzeugten SVG in mm
* paintBackground - bool - paint/do not paint background
* paintBackground - bool - paint/do not paint background
* backgroundColor - tuple - (r,g,b,a)
* backgroundColor - tuple - (r,g,b,a)

Revision as of 12:47, 25 December 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: eine Kopie des pageObject im PDF-Format speichern nach location filePath

Returns: none

exportPageAsSvg(pageObject, filePath)

Description: eine Kopie des pageObject im SVG-Format speichern nach location filePath

Returns: none

copyActiveViewToSvgFile(document, filePath, (options))

Description: eine Kopie der aktuellen Ansicht als "Dokument" speichern in die Datei "filePath"

Returns: double (estimated scale)

Optionen:

  • width - float - width des erzeugten SVG in mm
  • height - float - height des erzeugten 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)