TechDrawGui API
Jump to navigation
Jump to search
TechDraw
User documentation
(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)
Description: save a copy of pageObject in PDF format to location filePath
Returns: none
Description: save a copy of pageObject in SVG format to location filePath
Returns: none
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)
Description: add a QGraphicsItem (created using PySide) to a View
Returns: none
- Pages: Insert Default Page, Insert Page using Template, Redraw Page
- Views: Insert View, Insert Active View, Insert Projection Group, Insert Section View, Insert Detail View, Insert Draft Workbench Object, Insert Arch Workbench Object, Insert Spreadsheet View
- Clips: Insert Clip Group, Add View to Clip Group, Remove View from Clip Group
- Dimensions: New Length, New Horizontal, New Vertical, New Radius, New Diameter, New Angle, New Angle3Pt, New Links, New Balloon
- Decorations: Hatch Face using Image File, Apply Geometric Hatch to Face, Insert SVG Symbol, Insert Bitmap Image, Turn View Frames On/Off
- Annotations: Insert Annotation, Add Leaderline to View, Insert Rich Text Annotation, Add Cosmetic Vertex, Add Midpoint Vertices, Add Quadrant Vertices, Add Centerline to Face(s), Add Centerline between 2 Lines, Add Centerline between 2 Points, Remove Cosmetic Object, Change Appearance of Line(s), Show/Hide Invisible Edges, Add Welding Information to Leader
- Import/Export: Export Page as SVG, Export Page as DXF
- Additional: Preferences; Hatching, LineGroup, Templates; TechDraw API, TechDrawGui API

- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties; Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base; Arch, Draft, FEM, Image, Inspection, Mesh, OpenSCAD, Part, PartDesign, Path, Points, Raytracing, Reverse Engineering, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Deprecated or unmaintained workbenches: Complete, Drawing, Robot
- Hubs: User hub, Power users hub, Developer hub