TechDrawGui API/it: Difference between revisions

From FreeCAD Documentation
(Created page with "{{VeryImportantMessage|(Novembre 2018) Queste informazioni potrebbero essere incomplete e obsolete. Per l'ultima API, consultare [https://www.freecadweb.org/api autogenerated...")
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{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|(Novembre 2018) Queste informazioni potrebbero essere incomplete e obsolete. Per l'ultima API, consultare [https://www.freecadweb.org/api autogenerated API documentation].}}
These functions are part of the [[TechDraw Workbench|TechDraw Workbench]] and can be used in [[macros|macros]] and from the [[Python|Python]] console once the {{incode|TechDrawGui}} module has been imported.
Queste funzioni fanno parte di [[TechDraw Workbench/it|TechDraw]] e possono essere utilizzate nelle [[macros/it|macro]] e dalla console [[Python/it|Python]] dopo l'importazione del modulo {{incode|TechDraw}}.


See the [[TechDraw API|TechDraw API]] for more functions.
Vedere [[TechDraw API/it|TechDraw API]] per altre funzioni.


Esempio:
Example:
{{Code|code=
{{Code|code=
import FreeCAD
import FreeCAD
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)
<br/>
{{APIFunction|addQGIToView|view, QGraphicsItem|add a QGraphicsItem (created using PySide) to a View|none}}


{{TechDraw Tools navi}}
{{TechDraw Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

[[Category:API/it]]
[[Category:API{{#translation:}}]]
[[Category:Poweruser Documentation{{#translation:}}]]


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

Latest revision as of 22:00, 21 September 2022

(Novembre 2018) Queste informazioni potrebbero essere incomplete e obsolete. Per l'ultima API, consultare autogenerated API documentation.

Queste funzioni fanno parte di TechDraw e possono essere utilizzate nelle macro e dalla console Python dopo l'importazione del modulo TechDraw.

Vedere TechDraw API per altre funzioni.

Esempio:

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