Howto modify an existing TechDraw workbench template in FreeCAD

Contents

  • 00:00 Introduction
  • 00:30 About InkScape
  • 01:01 Initial customisation to A5
  • 02:05 Testing the modified template
  • 02:45 Fixing the template
  • 04:34 Rinse and repeat
  • 06:35 Changing element attributes

Glasson Design Studio2022. All rights reserved.

FreeCAD's TechDraw workbench comes with a number of predefined templates that you can use, but what do you do if you want a custom template? You can modify an existing template, or you can create your own. I'm going to show you how you can create your own by modifying an existing template.

It's a fairly straightforward process that requires the use of another program that allows you to create and modify drawings stored in SVG files. We use InkScape to do this. You could use something else if you prefer. InkScape is available on Windows, Mac, and Linux.

InkScape website

https://inkscape.org

InkScape allows you to create sophisticated drawings and edit the XML1 which forms the basis of the SVG structure. This means that applications such as InkScape can attach additional information to the graphical elements in the file which FreeCAD can use when displaying the file.

You can create a static template that does not allow the user to modify the text in the template or you can create a template that allows the user to insert their own descriptive text into the text fields that you have defined as being editable.

Important

You can tell the difference between a static template and one that allows you to edit the text items by looking for a small green square next to the text item. You can click on the green square to open a dialogue box that allows you to change the text. A text item without a green square CANNOT be edited.

Modifying a template

The process of modifying an existing template is straightforward, but you need to give some thought to how it is going to look before you start. These are the steps that you'll need to follow to modify the template.

Warning

InkScape will often automatically add a <transform> attribute to graphical elements when you resize them. The <transform> attribute is not correctly handled by FreeCAD's TechDraw workbench and they need to be removed in InkScape.

This can be a time consuming process because you have to identify all the transformed elements, some of which may not be immediately obvious in InkScape, and then you will need to test the changes in FreeCAD.

Tip

Try to keep the overall aspect ratio of the resized elements the same before ungrouping them. This will help your new template retain the original look and feel. You can resize elements independently once you have ungrouped the elements.

  • Copy the existing template (so you don't destroy the original)
  • Set the page size
  • Resize the existing template to fit your new size
  • Ungroup the elements
  • Identify elements with <transform> attribute, removing the attribute and adjusting the size and position as required
  • Repeat ungrouping and deleting the <transform> attribute as necessary
  • Save template and test in FreeCAD

The template you've just created can now be used but it WILL NOT allow you to edit any of the text in it. We find it useful to create a new drawing using the new templatein a FreeCAD model so that we can confirm that it looks the way we expect it to and make any changes prior to making the text editable. You don't have to do this.

Other embellishments

The SVG file allows you a high level of control over the look of the template which means that you can include logos, other images, special fonts, line styles, line weights, etc. You can create simple templates like we do, or you could get a graphic artist to help you design a template that is consistent with your organisations branding.

Links

  • 1Checkout the link at the bottom of the article for more informationabout XML