TechDraw Templates: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
(Undo revision 1357251 by David69 (talk)Idem.)
Tag: Undo
 
(26 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:27-->
<!--T:27-->
{{Docnav
{{Docnav
|[[TechDraw_LineGroup|Line Groups]]
|[[TechDraw_LineGroup|LineGroups]]
|[[TechDraw_Hatching|Hatching]]
|[[TechDraw_Hatching|Hatching]]
|[[TechDraw_Module|TechDraw]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=
|IconL=
|IconC=Workbench_TechDraw.svg
|IconR=
|IconR=
|IconC=Workbench_TechDraw.svg
}}
}}


Line 14: Line 15:
{{TOCright}}
{{TOCright}}
<translate>
<translate>

== Overview == <!--T:10-->
== Description == <!--T:10-->


<!--T:11-->
<!--T:11-->
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.
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.


<!--T:22-->
<!--T:22-->
Line 23: Line 25:


<!--T:12-->
<!--T:12-->
Templates are [[SVG]] files which can be created and modified outside of FreeCAD, with an application such as [https://en.wikipedia.org/wiki/Inkscape Inkscape].
Templates are [[SVG|SVG]] files which can be created and modified outside of FreeCAD, with an application such as [https://en.wikipedia.org/wiki/Inkscape Inkscape].


== Properties == <!--T:13-->
== Properties == <!--T:13-->
Line 31: Line 33:
* {{PropertyData|Width}}: Paper width in mm.
* {{PropertyData|Width}}: Paper width in mm.
* {{PropertyData|Height}}: Paper height in mm.
* {{PropertyData|Height}}: Paper height in mm.
* {{PropertyData|Page 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.
* {{PropertyData|Page 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.
* {{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:31-->
== Select a different template file == <!--T:33-->

To change the template of a drawing
<!--T:31-->
# click the desired page in the tree
To select a different template for a drawing:
# if not already open the tree should open a small sub-tree with several leaves
# Locate the desired Page object in the [[Tree_view|Tree view]].
# Select the Template leaf
# Expand the Page node if necessary.
# 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).
# Select the Template object.
# select another template file.
# In the [[Property_editor|Property editor]] click in the {{PropertyData|Template}} property field.
The new file will be opened directly.
# Press the {{Button|...}} (ellipsis) button that appears.
# A file dialog opens the folder the current template is located in. If the Page was created in the current FreeCAD session this will be the default template folder (as set in the [[TechDraw_Preferences#Files|TechDraw Preferences]]).
# Optionally browse to another folder.
# Select a different template file.
# Press the {{Button|OK}} button.


<!--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 have modified a template file and want to update a Page created in the current FreeCAD session that uses this template, temporarily select a different file first, and then select the modified file again.


== Custom Templates == <!--T:15-->
== Custom Templates == <!--T:15-->
Line 67: Line 74:


<!--T:24-->
<!--T:24-->
Custom templates can also be specified as a default in the [[TechDraw Preferences]].
Custom templates can also be specified as a default in the [[TechDraw_Preferences|TechDraw Preferences]].


<!--T:17-->
<!--T:17-->
See also [[TechDraw_TemplateHowTo|How to make a custom TechDraw template]].
See also [[TechDraw_TemplateHowTo|How to make a custom TechDraw template]], or, if you prefer script generated templates, [[TechDraw_TemplateGenerator|TechDraw TemplateGenerator]] and [[Macro_TemplateHelper|Macro TemplateHelper]].


== Notes == <!--T:19-->
== Notes == <!--T:19-->
Line 76: Line 83:
<!--T:20-->
<!--T:20-->
* TechDraw Templates are not entirely interchangeable with [[Drawing_templates|Drawing Templates]]. In general, Drawing templates will work in TechDraw, but there may be problems with editable text.
* TechDraw Templates are not entirely interchangeable with [[Drawing_templates|Drawing Templates]]. In general, Drawing templates will work in TechDraw, but there may be problems with editable text.

<!--T:34-->
* The library FreeCAD uses to process SVG '''only supports the svg-tiny specification'''. In particular: "SVG Tiny does not support gradients, transparency, clipping, masks, symbols, patterns, underline text, strike through text, vertical text, or SVG filter effects." (from Adobe Illustrator Help). Using these features in your custom template will cause problems in rendering.


<!--T:9-->
<!--T:9-->
Line 81: Line 91:


<!--T:29-->
<!--T:29-->
* 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.
* 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.


<!--T:30-->
<!--T:30-->
* Templates work best when they contain no extraneous SVG code (called "garbage SVG" by some). There is a good article on [https://freecad-gost.ru/news/gost-templates-techdraw-09-01-2020/ removing garbage from SVG here]. The article is in Russian.
* Templates work best when they contain no extraneous SVG code (called "garbage SVG" by some). There is a good article on [https://freecad-gost.ru/news/gost-templates-techdraw-09-01-2020/ removing garbage from SVG here]. The article is in Russian.



<!--T:28-->
<!--T:28-->
{{Docnav
{{Docnav
|[[TechDraw_LineGroup|Line Groups]]
|[[TechDraw_LineGroup|LineGroups]]
|[[TechDraw_Hatching|Hatching]]
|[[TechDraw_Hatching|Hatching]]
|[[TechDraw_Module|TechDraw]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=
|IconL=
|IconC=Workbench_TechDraw.svg
|IconR=
|IconR=
|IconC=Workbench_TechDraw.svg
}}
}}


Line 99: Line 110:
{{TechDraw Tools navi{{#translation:}}}}
{{TechDraw Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 15:37, 22 January 2024

Description

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.

Select a different template file

To select a different template for a drawing:

  1. Locate the desired Page object in the Tree view.
  2. Expand the Page node if necessary.
  3. Select the Template object.
  4. In the Property editor click in the DataTemplate property field.
  5. Press the ... (ellipsis) button that appears.
  6. A file dialog opens the folder the current template is located in. If the Page was created in the current FreeCAD session this will be the default template folder (as set in the TechDraw Preferences).
  7. Optionally browse to another folder.
  8. Select a different template file.
  9. Press the OK button.

If you have modified a template file and want to update a Page created in the current FreeCAD session that uses this template, temporarily select a different file first, and then select the modified file again.

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, or, if you prefer script generated templates, TechDraw TemplateGenerator and Macro TemplateHelper.

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 library FreeCAD uses to process SVG only supports the svg-tiny specification. In particular: "SVG Tiny does not support gradients, transparency, clipping, masks, symbols, patterns, underline text, strike through text, vertical text, or SVG filter effects." (from Adobe Illustrator Help). Using these features in your custom template will cause problems in rendering.
  • 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.