Drawing templates/sv: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
Att skapa mallar för Ritningsmodulen är mycket lätt. De är svg filer, som kan skapas med valfri applikation som är kapabel att exportera svg filer, Som [http://www.inkscape.org inkscape]. Endast två regler måste följas:
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 [http://www.inkscape.org Inkscape]. Only two rules must be followed:
* En pixel = en milimeter
* One pixel = one millimeter
* 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:
* Någonstans i svg koden så måste du sätta in var du vill att ritningsinnehållet ska synas (Till exempel i slutet av filen, precis innan den sista </svg> taggen), följande rad:
<syntaxhighlight>
<syntaxhighlight>
<!-- DrawingContent -->
<!-- DrawingContent -->
Line 37: Line 37:
</syntaxhighlight>
</syntaxhighlight>


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:
* Several custom attributes can be placed in templates. The list of currently supported attributes is available on the [[Svg Namespace]] page.
* xxx = pixel width

* yyy = pixel height
<syntaxhighlight>
width="xxxmm"
height="yyymm"
viewBox="0 0 xxx yyy"
</syntaxhighlight>


* Several custom attributes can be placed in templates. The list of currently supported attributes is available on the [[Svg Namespace]] page.


==A3 templates ==
==A3 templates ==

Revision as of 17:23, 25 January 2014

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. Only two rules must be followed:

  • One pixel = one millimeter
  • 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 -->

In addition to these two rules, as of FreeCAD 0.14, Revision 2995, 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 -->

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 the 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 the the bottom of the Border.

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 the 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 the the bottom of the Title block
  • X1a <= X1 or X2a >= X2
  • Y1a <= Y1 or Y2a >= Y2

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.

A3 templates

A3 Classic:

A3 Clean:

A3 Modern:

A3 Showcase:

A3 Landscape english:

A4 Templates

A4 Landscape english:

A4 Portrait 1 english:

US Letter Templates

US Letter landscape:


US Letter portrait:

US Letter ds Landscape:

US Legal ds Landscape:

US Ledger ds Landscape:

Other standards available