TechDrawGui API/fr: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Created page with "Voir TechDraw API pour plus de fonctions.")
Line 3: Line 3:
Ces fonctions font partie de l'[[TechDraw Workbench/fr|Atelier TechDraw]] et peuvent être utilisées dans [[macros/fr|macros]] et à partir de la console [[Python/fr|Python]] une fois que le module {{incode|TechDrawGui}} a été importé.
Ces fonctions font partie de l'[[TechDraw Workbench/fr|Atelier TechDraw]] et peuvent être utilisées dans [[macros/fr|macros]] et à partir de la console [[Python/fr|Python]] une fois que le module {{incode|TechDrawGui}} a été importé.


See the [[TechDraw API|TechDraw API]] for more functions.
Voir [[API TechDraw/fr|TechDraw API]] pour plus de fonctions.


Example:
Example:

Revision as of 15:09, 9 April 2020

(Novembre 2018) Ces informations peuvent être incomplètes et obsolètes. Pour la dernière API, consultez autogenerated API documentation.

Ces fonctions font partie de l'Atelier TechDraw et peuvent être utilisées dans macros et à partir de la console Python une fois que le module TechDrawGui a été importé.

Voir TechDraw API pour plus de fonctions.

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

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)


addQGIToView(view, QGraphicsItem)

Description: add a QGraphicsItem (created using PySide) to a View

Returns: none