Sandbox:TechDraw template creation tutorial

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 is intended to be a parallel version for wandererfan's template tutorial because I personally found the guide to be a bit too hard to follow from a beginner standpoint. Here so my aim is to make a version intended for beginners that includes more information and guidance.

This tutorial assumes you have relatively little experience with Inkscape and SVG, as well as FreeCAD and the TechDraw Workbench.

In this tutorial we're going to make a simple template for US Letter or ISO 216 A4 size paper in landscape orientation. The process is the same for any paper size and once you've finished your first template, it's relatively easy to create templates for other page sizes and orientations.

A copy of the result of this tutorial is not available in

Where is the directory where FreeCAD was installed, for example

Create base document
1. Open a new document in Inkscape. All of the following steps will be carried out within Inkscape. During this tutorial, FreeCAD and TechDraw are only useful for inspecting the state of your template by opening the TechDraw workbench, clicking "Insert Page using Template" and selecting the template you are working on.

2. Use the built-in XML Editor or ++) to add a "freecad" namespace clause to the  item.
 * Select the topmost item and press the  located on the top left of the contents window to create a new entry
 * In the Name field of the new item, paste
 * In the Attribute field, paste  . Press  to confirm the edit to the namespace; if you just click away, the edit will revert.

Note that your editable texts will not work if you use "https://...", even though the wiki is reached via https these days. Since SVG is a human readable format you could also enter the line above into the file with a text editor.

3. Set up some references

The finished template is likely to turn out irregular and messy if made without any references for the placement of lines, text and other items. Open and click  to create a new grid.
 * A set of grid properties will shown, adjust these to your liking. For example, to get a 1 by 1 mm grid, set Grid units: to and both Spacing X: and Spacing Y: to
 * Also, you can set the interval of major grid lines for easier readability by changing the Major grid line every: parameter.

2. Set page size

In Document Properties ( or ++)
 * Select page size "US Letter" or "A4" and orientation "landscape".
 * Set default units to "mm". For US Letter, set the page size to width "279.4" and height "215.9". For A4 you would use "210" and "297".

Create the template drawing
4. Draw outlines, zone numbers, centering 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:

Create editable fields
9. Use the XML Editor to add a tag to each editable  item.
 * Assign a meaningful field name to each editable text.

Adjust size of the SVG
10. Use the XML editor to adjust the attribute to match your page size in millimeters.
 * It is four values, in the format

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

12. We need to shrink it.
 * , or box select and select all.
 * Adjust the and  spinboxes to match your artwork's size in millimeters.
 * Set it to the page size less any applicable margins, for example,, and.

13. Use "Align and Distribute" or the and  spinboxes to position the artwork within the limits of the page if required.

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

Remove transformans on the SVG
15. Ensure that all your editable texts are "ungrouped" with ++.

16. Select everything on your page,, and then (+).

17. Then delete the current layer,.
 * Note: if you deleted the layer already (in your layer panel is no layer listed) this step is not required. In that case you should select all (+), cut the selection (+) and paste it with the command in the next step.

18. Then paste,.
 * Note: This command prevents that the text positions are stored in transform tags. It's important that you do not use the normal paste command!

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.