TechDraw Templates: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
(Change could be read as "alter" and so exchange is more precise. I hope that is the case for the other edited text as well. I Still don't like the T:32 paragraph.)
Line 35: Line 35:
* {{PropertyData|Template}}: a) A pointer to the copy of the original Template file which is incorporated into this *.FCSTD file, or b) a filepath to a template accessible on the current machine. Use the file selection ellipsis (...) to change to a different template.
* {{PropertyData|Template}}: a) A pointer to the copy of the original Template file which is incorporated into this *.FCSTD file, or b) a filepath to a template accessible on the current machine. Use the file selection ellipsis (...) to change to a different template.


== Changing Template File == <!--T:33-->
== Exchanging a Template file == <!--T:33-->


<!--T:31-->
<!--T:31-->
To change the template of a drawing
To exchange the template of a drawing:
# click the desired page in the tree
# Locate the desired Page object in the [[Tree_view|tree view]].
# Expand the Page branch if necessary.
# if not already open the tree should open a small sub-tree with several leaves
# Select the Template leaf
# Select the Template object.
# In the property panel first click on the path field of the {{PropertyData|Template}} property
# in the property panel/Data Tab/Template is the path to the template file. To change the file press the ellipsis button ('...'). This will open your default template folder (as set in Preferences/TechDraw).
#: and then on the {{Button|...}} (ellipsis) button that has appeared at the end of the path.
# select another template file.
# A file dialog opens the default template folder (as set in the [[TechDraw_Preferences#Files|TechDraw Preferences]]).
The new file will be opened directly.
# Select another template file.
# Press the {{Button|OK}} button.
The new template will immediately replace the old one.


<!--T:32-->
<!--T:32-->
When you want to update a changed template file note that you have to load another file before you can select the same file again. This is because the selection of the same file is ignored.
If you want to update an exchanged template file, note that you have to load another file before you can select the same file again. This is because the selection of the same file is ignored.


== Custom Templates == <!--T:15-->
== Custom Templates == <!--T:15-->

Revision as of 13:13, 13 August 2022

Overview

Every TechDraw page is based on a Template object. The Template controls paper size and contains fixed text graphics and text, for example, a page frame or border.

The Template can also contain editable text fields for attributes like Title, Subtitle, Author, Date, Scale, Weight, Drawing number and Sheet.

Templates are SVG files which can be created and modified outside of FreeCAD, with an application such as Inkscape.

Properties

  • DataOrientation: Portrait or Landscape.
  • DataWidth: Paper width in mm.
  • DataHeight: Paper height in mm.
  • DataPage Result: A copy of the original Template file including all changes to editable texts. This allows users who may not have a copy of the Template file to see the Page as intended. Not typically useful for end users.
  • DataTemplate: a) A pointer to the copy of the original Template file which is incorporated into this *.FCSTD file, or b) a filepath to a template accessible on the current machine. Use the file selection ellipsis (...) to change to a different template.

Exchanging a Template file

To exchange the template of a drawing:

  1. Locate the desired Page object in the tree view.
  2. Expand the Page branch if necessary.
  3. Select the Template object.
  4. In the property panel first click on the path field of the DataTemplate property
    and then on the ... (ellipsis) button that has appeared at the end of the path.
  5. A file dialog opens the default template folder (as set in the TechDraw Preferences).
  6. Select another template file.
  7. Press the OK button.

The new template will immediately replace the old one.

If you want to update an exchanged template file, note that you have to load another file before you can select the same file again. This is because the selection of the same file is ignored.

Custom Templates

A limited number of pre-formatted templates in various standard page sizes are included with FreeCAD. These are found in

$INSTALL_DIR/Mod/TechDraw/Templates/

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

/usr/share/freecad/Mod/TechDraw/Templates/

Custom templates can also be specified as a default in the TechDraw Preferences.

See also How to make a custom TechDraw template.

Notes

  • TechDraw Templates are not entirely interchangeable with Drawing Templates. In general, Drawing templates will work in TechDraw, but there may be problems with editable text.
  • The xml:space="preserve" clause sometimes causes problems with text size and positioning. It is best to avoid/remove this clause from your custom template's SVG code.
  • Templates work best when they contain no extraneous SVG code (called "garbage SVG" by some). There is a good article on removing garbage from SVG here. The article is in Russian.