TechDraw TemplateHowTo

From FreeCAD Documentation
Revision as of 23:55, 24 November 2018 by Vocx (talk | contribs) (Moved information to the introduction)
Jump to navigation Jump to search
Other languages:
Deutsch • ‎English • ‎français • ‎italiano • ‎русский
Base ExampleCommandModel.png Tutorial
Topic
Drafting
Level
Intermediate
Time to complete
60 minutes
Authors
wandererfan
FreeCAD version
0.17
Example files
None


Introduction

This tutorial shows you how to create an SVG file that can be used as the background template for the TechDraw Workbench pages.

This tutorial assumes you are moderately familiar with Inkscape and SVG, as well as FreeCAD and the TechDraw Workbench.

We're going to make a simple template for US Letter size paper in landscape orientation.

A copy of the result of this tutorial is available in

$INSTALL_DIR/Mod/TechDraw/Templates/HowToExample.svg

Where $INSTALL_DIR is the directory where FreeCAD was installed, for example

/usr/share/freecad/Mod/TechDraw/Templates/HowToExample.svg

Steps

1. Open a new document in Inkscape.

2. In Document Properties

  • Select page size "US Letter" and orientation "landscape".
  • Set default units and page size units to mm, 279.4 x 215.9.
InkDocProp.png

Template:CaptionCenter


3. Use the XML Editor to add a "freecad" namespace clause to the <svg> item.

InkXMLNameSpace.png

Template:CaptionCenter


4. Draw outlines, zone numbers, center lines, and other geometry.

5. Draw the boxes and lines for the title block.

6. Add and position your static text.

7. Add and position the text that will be editable.

8. You now have your finished artwork, that should look something like this:

InkFinishedArt.png

Template:CaptionCenter


9. Use the XML Editor to add a freecad:editable tag to each editable <text> item.

  • Assign a meaningful field name to each editable text.
InkXMLeditableTag.png

Template:CaptionCenter


10. Use the XML editor to adjust the viewbox to match your page size in millimeters.

  • It is four values, in the format [0 0 length height]
InkXMLviewBox.png

Template:CaptionCenter


11. Your template will now appear much bigger than desired.

InkMuchTooBig.png

Template:CaptionCenter


12. We need to shrink it.

  • Edit → Select All in All Layers, or box select and select all.
  • Adjust the W: and H: spinboxes to match your artwork's size in millimeters.
    • Set it to the page size less any applicable margins.

13. Use "Align and Distribute" or the X: and Y: spinboxes to position the artwork on page if required.

14. Your template should now look right, just like it did in the finished artwork picture above.

15. Ensure that all your editable texts are "ungrouped" with Shift+Ctrl+g.

16. Select everything on your page, Edit → Select All, and then Edit → Copy.

17. Then delete the current layer, Layer → Delete Current Layer.

18. Then paste, Edit → Paste in Place.

19. Your template should now look right and shouldn't have any unwanted transforms.

20. Save your template.

21. Try it in FreeCAD and TechDraw Workbench with TechDraw New Pick.

FCTemplateHow.png

Template:CaptionCenter


Notes

Don't use Layers in Inkscape until you've mastered template creation without them. Layers and Groups can automatically insert unwanted transforms into your SVG file.

See a Stackoverflow discussion on removing transform clauses in SVG files.