Drawing templates/it: Difference between revisions

From FreeCAD Documentation
(Created page with "In questo caso deve essere formattato come nell'esempio sottostante dove: * xxx = pixel width larghezza * yyy = pixel height altezza")
(Updating to match new version of source page)
Line 1: Line 1:

== SVG templates creation ==

Creare dei nuovi modelli di fogli per il modulo di disegno di proiezione [[Drawing Module/it|Drawing]] è molto semplice. Oltre a questa pagina consultare anche il tutorial [[Drawing_Template_HowTo/it|Creare dei modelli]]. I modelli sono dei file SVG creati con qualsiasi applicazione in grado di esportare file SVG, ad esempio [http://www.inkscape.org Inkscape]. Si devono seguire solo due regole:
Creare dei nuovi modelli di fogli per il modulo di disegno di proiezione [[Drawing Module/it|Drawing]] è molto semplice. Oltre a questa pagina consultare anche il tutorial [[Drawing_Template_HowTo/it|Creare dei modelli]]. I modelli sono dei file SVG creati con qualsiasi applicazione in grado di esportare file SVG, ad esempio [http://www.inkscape.org Inkscape]. Si devono seguire solo due regole:
* Un pixel = un millimetro
* Un pixel = un millimetro
Line 51: Line 54:


* Di default, i modelli di squadrature, nei sistemi Windows si trovano in ''C:/Program Files/FreeCAD0.13/data/Mod/Drawing/Templates/A3_Landscape.svg'', e nei sistemi Linux in ''/usr/share/freecad/Mod/Drawing/Templates/A3_Landscape.svg''.
* Di default, i modelli di squadrature, nei sistemi Windows si trovano in ''C:/Program Files/FreeCAD0.13/data/Mod/Drawing/Templates/A3_Landscape.svg'', e nei sistemi Linux in ''/usr/share/freecad/Mod/Drawing/Templates/A3_Landscape.svg''.

== DXF templates ==

Since version 0.15, FreeCAD can reliably export a [[Drawing Module|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
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.


== Modelli A3 ==
== Modelli A3 ==

Revision as of 14:31, 11 February 2015

SVG templates creation

Creare dei nuovi modelli di fogli per il modulo di disegno di proiezione Drawing è molto semplice. Oltre a questa pagina consultare anche il tutorial Creare dei modelli. I modelli sono dei file SVG creati con qualsiasi applicazione in grado di esportare file SVG, ad esempio Inkscape. Si devono seguire solo due regole:

  • Un pixel = un millimetro
  • È necessario inserire, da qualche parte all'interno del proprio codice svg, dove si desidera che appaia il contenuto del disegno (per esempio alla fine del file, appena prima dell'ultimo tag </svg>), la seguente riga:
 <!-- DrawingContent -->

Oltre a queste due regole, a partire da FreeCAD 0.14, Rev. 2995, al modello possono essere aggiunte le informazioni sul bordo e sulla tabella. Esse sono usate dallo strumento di proiezione ortogonale e definiscono dove FreeCAD può, e non può effettuare le proiezioni.

Per definire il bordo dell'area utilizzata, prima del tag <metadata nel file svg, deve apparire la seguente riga:

<!-- Working space X1 Y1 X2 Y2 -->

Dove:

  • X1 è la distanza dell'asse X dal lato sinistro della pagina al lato sinistro del bordo.
  • Y1 è la distanza dell'asse Y dal lato superiore della pagina al lato superiore del bordo.
  • X2 è la distanza dell'asse X dal lato sinistro della pagina al lato destro del bordo.
  • Y2 è la distanza dell'asse Y dal lato superiore della pagina al lato inferiore del bordo.

Per definire l'area della tabella, prima del tag <metadata e dopo il tag dell'area di lavoro, si deve inserire la seguente riga:

<!-- Title block X1a Y1a X2a Y2a -->

Dove:

  • X1a è la distanza dell'asse X dal bordo sinistro della pagina al lato sinistro del blocco del titolo.
  • Y1a è la distanza dell'asse Y dal bordo superiore della pagina al lato superiore del blocco del titolo.
  • X2a è la distanza dell'asse X dal bordo sinistro della pagina al lato destro del blocco del titolo.
  • Y2a è la distanza dell'asse Y dal bordo superiore della pagina al lato inferiore del blocco del titolo.
  • X1a <= X1 oppure X2a >= X2
  • Y1a <= Y1 oppure Y2a >= Y2

Il seguente è un esempio del codice che deve essere inserito prima del tag <metadata per definire l'area di lavoro e l'area della tabella. Non è obbligatorio definire una tabella, ma quando si fa la tabella deve essere definita nella riga successiva a quella della definizione dello spazio di lavoro:

<!-- Working space X1 Y1 X2 Y2 -->
<!-- Title block X1a Y1a X2a Y2a -->

Per scalare la stampa, la dimensione effettiva deve essere data negli attributi width e height del tag SVG. Le dimensioni del documento, nelle unità utilizzate (px), deve essere fornita nell'attributo Viewbox.

In questo caso deve essere formattato come nell'esempio sottostante dove:

  • xxx = pixel width larghezza
  • yyy = pixel height altezza
width="xxxmm"
height="yyymm"
viewBox="0 0 xxx yyy"
  • Nelle squadrature si possono posizionare diversi attributi personalizzati. L'elenco degli attributi attualmente supportati sono disponibili nella pagina Svg Namespace.
  • Di default, i modelli di squadrature, nei sistemi Windows si trovano in C:/Program Files/FreeCAD0.13/data/Mod/Drawing/Templates/A3_Landscape.svg, e nei sistemi Linux in /usr/share/freecad/Mod/Drawing/Templates/A3_Landscape.svg.

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
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.

Modelli A3

A3 Classic:

A3 Clean:

A3 Modern:

A3 Showcase:

A3 Landscape english:

Modelli A4

A4 Landscape english:

A4 Portrait 1 english:

Modelli US Letter

US Letter landscape:


US Letter portrait:

US Letter ds Landscape:

US Legal ds Landscape:

US Ledger ds Landscape:

Altri standard disponibili