Categories
FreeCAD

Adding editable field to custom surface roughness annotation symbol for FreeCAD TechDraw

Modifying text in editable text field of a custom surface roughness annotation symbol

I am going to show you how you can add editable textfields to your custom TechDraw symbols. I will use the surface roughness symbol that I have already created as a starting point.

Enabling editable fields for FreeCAD TechDraw in the SVG

To generally enable editable fields you first need to add a freecad namespace clause as an attribute to the top level tag in the SVG of your symbol. To do that, open your SVG symbol in Inkscape and open the XML Editor. Next you select the top level SVG tag in the hierarchy and add a new attribute to that with the following properties:

Name: xmlns:freecad

Value: http://www.freecadweb.or/wiki/index.php?title=Svg_Namespace

You have now added support for editable fields in your symbol.

Adding a property to the top level svg tag in Inkscape to enable FreeCAD editable fields

Adding a placeholder text field to the surface roughness symbol in Inkscape

Next you place a placeholder text where you want your editable field to be. After creating the texfield you need to make it editable in FreeCAD TechDraw.

To make the textfield that you just placed editable in TechDraw, add a new attribute in the XML Editor of Inkscape to it with the following properties:

Name: freecad:editable

Value: <define any descriptive name for your field here>

There is on thing that you still need to do. Remove the xml:space=”preserve” attribute from your text fields. If you do not remove this attribute, the text fields will appear shifted in any direction when you place them on the TechDraw page.

You can generally create as many editable text fields as you want.

You have now successfully created your custom symbol with an editable field.

Creating a placeholder textfield and making it editable

Testing the editable field on a TechDraw page

Before your use or show your new custom symbol to anyone, first test it out. I would recommend placing multiple symbols and changing each one to have a different text in the editable field. Also play around with the scaling of the symbol to see of any issues arise.

If everything works well, share your custom symbols with the FreeCAD community in the forum or any of the other social media (Twitter with #FreeCAD, FreeCAD Facebook groups, Reddit….)

Using editable field in custom surface roughness annotation symbol to change value

Getting Started with FreeCAD

Jumpstart your first 3D CAD project with the open-source software FreeCAD and this illustrated step-by-step guide.

Exploring newest story

Share this:
Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *