Svg Namespace/it: Difference between revisions

From FreeCAD Documentation
(Created page with "====Spiegazioni====")
(Created page with "== Altri attributi disponibili ==")
Line 166: Line 166:
* replace by '''freecad:editable''' = "AuthorName"
* replace by '''freecad:editable''' = "AuthorName"


== Altri attributi disponibili ==
==Other attributes availlables==


See [[Drawing_templates]]
See [[Drawing_templates]]

Revision as of 20:53, 16 January 2014

Nei documenti SVG esportati dal Modulo Disegno di FreeCAD e utilizzati come modelli di pagina (squadrature), si possono utilizzare diversi attributi personalizzati, originariamente per uso interno di FreeCAD, ma che, in futuro, potrebbero essere utilizzati anche da altre applicazioni sopra FreeCAD . Tutti questi attributi utilizzano il prefisso freecad: per il namespace. L'URL del namespace definito in tali documenti SVG fa riferimento a questa pagina.

Utilizzo

Un pixel = un millimetro

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


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:freecad="http://www.freecadweb.org/wiki/index.php?title=Svg_Namespace"

Additional information for Working space and Title block may be added, and is defined on the Drawing templates page.

Attributi

freecad:EditableText

Per utilizzare uno degli attributi freecad: nei documenti SVG, si deve prima definire il namespace freecad come attributo del tag di apertura <svg>:

Definisce un testo in un modello che può essere modificato da FreeCAD.

Esempio:

 <text freecad:EditableText="MyTitleText">
     <tspan>This is a title</tspan>
 </text>

freecad:basepoint1

Definisce il primo punto di un oggetto di Quotatura (rappresentato come un gruppo in un documento SVG). Questo attributo viene utilizzato durante l'importazione del frammento di SVG in FreeCAD, per ricreare l'oggetto Quotatura. Il gruppo contiene i percorsi e altri elementi grafici per rappresentare correttamente l'oggetto Quotatura in altre applicazioni SVG.

Esempio:

 <g freecad:basepoint1="0.5 4.34" freecad:basepoint2="2.4 5.8" dimpoint="3.2 7.76">
     <path d="...">
 </g>

freecad:basepoint2

Definisce il secondo punto di un oggetto di Quotatura (rappresentato come un gruppo in un documento SVG). Questo attributo viene utilizzato durante l'importazione del frammento di SVG in FreeCAD, per ricreare l'oggetto Quotatura. Il gruppo contiene i percorsi e altri elementi grafici per rappresentare correttamente l'oggetto Quotatura in altre applicazioni SVG.

Esempio: vedere #freecad:basepoint1

freecad:dimpoint

Definisce il punto di un oggetto di Quotatura attraverso il quale passa la linea di quota. Questo attributo viene utilizzato durante l'importazione del frammento di SVG in FreeCAD, per ricreare l'oggetto Quotatura. Il gruppo contiene i percorsi e altri elementi grafici per rappresentare correttamente l'oggetto Quotatura in altre applicazioni SVG.

Esempio: vedere #freecad:basepoint1

Esempio di codice freecad:EditableText

Questo esempio è tratto dalla tabella del modello di squadratura A3_Landscape

1 : Title without textedit

  <g
     id="g3587">
    <text
       sodipodi:linespacing="119.00001%"
       id="text3482"
       y="229.10912"
       x="220.8476"
       style="font-size:1.97555566px;font-style:normal;font-weight:normal;line-height:119.00000572%;letter-spacing:0.01975556px;word-spacing:0.00846667px;writing-mode:lr-tb;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
       xml:space="preserve"><tspan
         y="229.10912"
         x="220.8476"
         id="tspan3484"
         sodipodi:role="line">AUTHOR NAME :</tspan></text>

2 : Title with textedit

  <g
     style="fill:none;stroke:#000000;stroke-width:0.13;stroke-linecap:butt;stroke-linejoin:miter"
     id="g578-7"
     transform="translate(0,4)">
    <text
       xml:space="preserve"
       style="font-size:4px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:sans;-inkscape-font-specification:sans"
       x="220.9935"
       y="228.95425"
       id="text3331"
       sodipodi:linespacing="125%"
       freecad:editable="AuthorName"><tspan
         sodipodi:role="line"
         id="tspan3333"
         x="220.9935"
         y="228.95425">AUTHOR NAME</tspan></text>
    <text
    ...
    ...
    ...
    ... </text>
  
  </g>

Spiegazioni

  <g

Beginning of the framework

     style="fill:none;stroke:#000000;stroke-width:0.13;stroke-linecap:butt;stroke-linejoin:miter"
     id="g578-7"
     transform="translate(0,4)">

Data on the framework

    <text

Beginning of the text block

       xml:space="preserve"
       style="font-size:4px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:sans;-inkscape-font-specification:sans"

All the information about the text that will be displayed

       x="220.9935"
       y="228.95425"
       id="text3331"
       sodipodi:linespacing="125%"

Coordinates and identity where the text will appear

       freecad:editable="AuthorName"><tspan

Here AuthorName is the var managed by freecad:editable who saves the string to change that will be displayed

         sodipodi:role="line"
         id="tspan3333"
         x="220.9935"
         y="228.95425">AUTHOR NAME</tspan></text>

Coordinates and identity of the text that is displayed by default and </text> means the end of the block text

    <text
    ...
    ...
    ...
    ... </text>
  </g>

Other blocks texts and end </g> the framework grouping text blocks

It is possible after having worked the Inkscape SVG file as the file no longer works, it is possible that information has gone missing.

Then check that the edit text is not modified

Example :

  • editable = "AuthorName"
  • replace by freecad:editable = "AuthorName"

Altri attributi disponibili

See Drawing_templates