20/1/2018 Drawing templates - FreeCAD Documentation
Drawing templates
Sumario
1 SVG templates creation
1.1 Base rules
1.2 Namespace
1.3 Title block
2 DXF templates
3 A3 templates
3.1 A3 Classic:
3.2 A3 Clean:
3.3 A3 Modern:
3.4 A3 Showcase:
3.5 A3 Landscape english:
4 A4 Templates
4.1 A4 Landscape english:
4.2 A4 Portrait 1 english:
5 US Letter Templates
5.1 US Letter landscape:
5.2 US Letter portrait:
5.3 US Letter ds Landscape:
5.4 US Legal ds Landscape:
5.5 US Ledger ds Landscape:
6 Other standards available
SVG templates creation
Creating templates for the Drawing module is very easy. See also the tutorial
Drawing_Template_HowTo. Templates are svg files, created with any application capable of
exporting svg files, such as Inkscape (http://www.inkscape.org). However, you will often need to
open the svg file in a text editor afterwards, to comply with the following rules. Only two rules must
be followed:
Base rules
One pixel = one millimeter. You can have the page size specified inside the opening <svg> tag,
either without units or with "mm". For example, these two forms are valid:
https://www.freecadweb.org/wiki/Drawing_templates 1/17
20/1/2018 Drawing templates - FreeCAD Documentation
width="1067mm"
height="762mm"
or
width="1067"
height = "762"
Although svg supports inches ("42 in"), these are currently not supported by FreeCAD, so it's always
better to have your svg page size specified in millimeters. The "viewBox" attribute must have the
same value, for example:
viewBox="0 0 1067 762"
You must insert, somewhere inside your svg code, where you want the contents of the drawing
to appear (for example at the end of the file, just before the last </svg> tag), the following line:
<!-- DrawingContent -->
This text above (which is actually an XML comment) must be on a separate line, and not embedded
in the middle of other pieces of text. Beware that if you reopen and resave your template in inkscape,
after adding the above line, inkscape will keep the line, but will add other xml elements on the same
line, causing the template to not work anymore. You will need to edit it with a text editor and isolate
the comment above on its own line again.
Namespace
Several objects (specifically those created with the Draft_Drawing command and if your
template has editable texts) use a special Svg Namespace specific to FreeCAD. This makes
FreeCAD able to detect specific items inside svg files, that other applications will just ignore.
If you plan to use any of these, you must add this line inside the opening <svg> tag, for example
together with the other xmlns lines added by inkscape:
xmlns:freecad="http://www.freecadweb.org/wiki/index.php?title=Svg_Namespace"
Title block
In addition to these rules, since FreeCAD 0.14, information about the Border and Title block can be
added to the template for use by the orthographic projection tool. This information defines where
FreeCAD can, and can not place the projections.
To define the Border, the following line must appear before the <metadata> tag in the svg file.
<!-- Working space X1 Y1 X2 Y2 -->
https://www.freecadweb.org/wiki/Drawing_templates 2/17
20/1/2018
<!-- Working space X1 Y1 X2 Y2 -->
Drawing templates - FreeCAD Documentation
Where X1, Y1, X2, Y2 are defined as:
X1 is the X axis distance from the left edge of the page to the left side of the Border.
Y1 is the Y axis distance from the top edge of the page to the top of the Border.
X2 is the X axis distance from the left edge of the page to the right side of the Border.
Y2 is the Y axis distance from the top edge of the page to the bottom of the Border.
X1 Y1
Y2
X2
To define the Title block the following line must be inserted before the <metadata> tag and after the
Working space tag.
<!-- Title block X1a Y1a X2a Y2a -->
Where X1a, Y1a, X2a, Y2a are defined as:
X1a is the X axis distance from the left edge of the page to the left side of the Title block
Y1a is the Y axis distance from the top edge of the page to the top of the Title block
X2a is the X Axis distance from the left edge of the page to the right side of the Title block
Y2a is the Y axis distance from the top edge of the page to the bottom of the Title block
X1a <= X1 or X2a >= X2
Y1a <= Y1 or Y2a >= Y2
Y1a
Y2a
X2a
X1a
https://www.freecadweb.org/wiki/Drawing_templates 3/17
20/1/2018 Drawing templates - FreeCAD Documentation
The following is an example of the code that defines the Working space and Title block areas that are
to be inserted before the <metadata> tag. You needn't specify a title block, but if you do it must be
defined on the next line immediately following the Working space:
<!-- Working space X1 Y1 X2 Y2 -->
<!-- Title block X1a Y1a X2a Y2a -->
In order to enable up to scale printing, the real word size has to be given in the width and height
attributes of the SVG-Tag. The size of the document in user units, (px), has to be given in the
viewBox attribute.
The following is to be formatted like the example below where:
xxx = pixel width
yyy = pixel height
width="xxxmm"
height="yyymm"
viewBox="0 0 xxx yyy"
Several custom attributes can be placed in templates. The list of currently supported attributes is
available on the Svg Namespace page.
DXF templates
Since version 0.15, FreeCAD can reliably export a Drawing page to the DXF format. This system
also uses templates. If a dxf file with the same name is found in the same folder as the SVG template
used for a page, it will be used for export. If not, a default empty template is created on the fly.
Consequently, if you create your own SVG templates, and wish to be able to export the Drawing
pages that you create with it to DXF, you just need to create a corresponding DXF template, and save
it with the same name in the same folder.
DXF templates can be created with any application that produces DXF files, such as LibreCAD. You
then need to edit them with a text editor, and add two additional lines, one at the beginning or end of
the BLOCKS section, and another at the beginning or end of the ENTITIES section, which are where
FreeCAD will add its own blocks and entities.
A very simple template looks like this:
999
FreeCAD DXF exporter v0.15
0
SECTION
2
HEADER
9
$ACADVER
https://www.freecadweb.org/wiki/Drawing_templates 4/17
20/1/2018 Drawing templates - FreeCAD Documentation
1
AC1009
0
ENDSEC
0
SECTION
2
BLOCKS
$blocks
0
ENDSEC
0
SECTION
2
ENTITIES
$entities
0
ENDSEC
0
EOF
The above template doesn't contain any entity. If you create your DXF file with a CAD application,
there will likely be much more content inside the HEADER, BLOCKS and ENTITIES sections.
The two lines that FreeCAD will be looking for are "$blocks" and "$entities". They must exist in the
template, and they must be placed on their own line. You can choose to place them right after the
BLOCKS or ENTITIES line, which is easier (just use the "search" function of your text editor to find
them), or at the end, just before the "0 ENDSEC" lines (beware that there is one for each SECTION,
make sure to use the ones relative to BLOCKS and ENTITIES). The latter method will place the
FreeCAD objects after the objects defined in the template, which might be more logical.
A3 templates
A3 Classic:
https://www.freecadweb.org/wiki/Drawing_templates 5/17
20/1/2018 Drawing templates - FreeCAD Documentation
TITLE
PROJECT PROJECT SCALE SCALE
PHASE PHASE AUTHOR AUTHOR NAME
DATE DATE REVISION REVISION
_A________
myLogo _B________
_C________
_D________
A3 Clean:
https://www.freecadweb.org/wiki/Drawing_templates 6/17
20/1/2018 Drawing templates - FreeCAD Documentation
DETAIL 01 TYPE PART
myLogo
myFirm Associates
PROJECT PROJECT SCALE SCALE PHASE PHASE AUTHOR AUT HOR REVISION REVISION DATE DAT E S unset B ld 2233
Los A ngeles CA
P hone 1122334455
Copyright
A3 Modern:
https://www.freecadweb.org/wiki/Drawing_templates 7/17
20/1/2018 Drawing templates - FreeCAD Documentation
TITLE 001
TITLE 002
PROJECT : PROJECT
PHASE : PHASE
SCALE : SCALE
AUTHOR : AUT HOR
REVISION : CONT ROLLED BY
DATE : DAT E
myLogo
COMPANY
ADRESS
LOCALIT Y
PHONE
COPYRIGHT
A3 Showcase:
https://www.freecadweb.org/wiki/Drawing_templates 8/17
20/1/2018 Drawing templates - FreeCAD Documentation
TYPE PART
DETAIL 01
PROJECT
PROJECT
SCALE
SCALE
PHASE
PHASE
AUTHOR
AUTHOR
DATE
DATE
REVISION
REVISION
myLogo
A3 Landscape english:
https://www.freecadweb.org/wiki/Drawing_templates 9/17
20/1/2018 Drawing templates - FreeCAD Documentation
01 001 - 001 ISO2768 - fH IRON
Quantity Part ID / number Fabrication tolerances Material
E: E_ Drawn by: DRAW_BY Scale :
D: D_ Controlled by: CONTROLLED_BY SCALE
MOD C:
B:
C_
B_
Date:
Controlled 2:
DATE
CONTROLLED 2
A: A_ Controlled 3: CONTROLLED 3
Co mp an y n ame: Part n ame: Pro ject n u mb er / Id :
COMPANY
ADRE SS
COUNTRY
PART NAME P roj ect num ber / Id
A4 Templates
A4 Landscape english:
https://www.freecadweb.org/wiki/Drawing_templates 10/17
20/1/2018 Drawing templates - FreeCAD Documentation
01 001 - 001 ISO2768 - fH IRON
Quantity Part ID / number Fabrication tolerances Material
E: E_ Drawn by: DRAW_BY Scale :
D: D_ Controlled by: CONTROLLED_BY SCALE
MOD C:
B:
C_
B_
Date: DATE
Controlled 2: CONTROLLED 2
A: A_ Controlled 3: CONTROLLED 3
Co mp an y n ame: Par t n ame: Pr o ject n u mb er / I d :
COMPANY
ADRESS
COUNTRY
PART NAME Project number / Id
A4 Portrait 1 english:
https://www.freecadweb.org/wiki/Drawing_templates 11/17
20/1/2018 Drawing templates - FreeCAD Documentation
US Letter Templates
US Letter landscape:
https://www.freecadweb.org/wiki/Drawing_templates 12/17
20/1/2018 Drawing templates - FreeCAD Documentation
US Letter portrait:
https://www.freecadweb.org/wiki/Drawing_templates 13/17
20/1/2018 Drawing templates - FreeCAD Documentation
US Letter ds Landscape:
https://www.freecadweb.org/wiki/Drawing_templates 14/17
20/1/2018 Drawing templates - FreeCAD Documentation
TITLE
DESCRIPTION
Scale : Title 0 : Date : Made With :
C SCALE TITLE 0 DATE FreeCAD
www.freecadweb.org
TEXT 1
TEXT 2
1 2 3 4
US Legal ds Landscape:
https://www.freecadweb.org/wiki/Drawing_templates 15/17
20/1/2018 Drawing templates - FreeCAD Documentation
TITLE
DESCRIP TION
Scale : T itle 0 : Date : Made W ith :
C SCALE TITLE 0 DATE FreeCAD
www. freecadweb. org
TEXT 1
TEXT 2
1 2 3 4
US Ledger ds Landscape:
https://www.freecadweb.org/wiki/Drawing_templates 16/17
20/1/2018 Drawing templates - FreeCAD Documentation
TITLE
DESCRIPTION
Scale : Title 0 : D ate : Mad e W ith :
SCALE TITLE 0 DATE FreeCAD
C TEXT 1
w w w .freecad w eb .o rg
TEXT 2
1 2 3 4
Other standards available
ANSI templates: according to American National Standards Institute ANSI (http://en.wikipedia.
org/wiki/American_National_Standards_Institute) standard
Arch templates: according to American National Standards Institute Arch (http://en.wikipedia.o
rg/wiki/American_National_Standards_Institute) standard
Misc templates: mixed templates
Obtenido de «http://www.freecadweb.org/wiki/index.php?
title=Drawing_templates&oldid=207135»
Se editó esta página por última vez el 14 oct 2016 a las 20:56.
El contenido está disponible bajo la licencia Creative Commons Attribution a menos que se
indique lo contrario.
https://www.freecadweb.org/wiki/Drawing_templates 17/17