TechDraw VorlagenAnleitung

From FreeCAD Documentation
Revision as of 22:42, 14 January 2019 by Le Loup (talk | contribs)
Tutorial
Topic
Drafting
Level
Intermediate
Time to complete
60 minutes
Authors
wandererfan
FreeCAD version
0.17
Example files
None
See also
None

Introduction

This tutorial shows you how to create an SVG file that can be used as the background template for the TechDraw Workbench pages.

Dieses Tutorial setzt moderates Kenntnisse in Inkscape und SVG sowie in FreeCAD und dem TechDraw-Arbeitsbereich voraus.

Wir erstellen ein einfaches Template für die Papiergrösse "US Letter Size" im Querformat.

A copy of the result of this tutorial is available in

$INSTALL_DIR/Mod/TechDraw/Templates/HowToExample.svg

Where $INSTALL_DIR is the directory where FreeCAD was installed, for example

/usr/share/freecad/Mod/TechDraw/Templates/HowToExample.svg

Wie erstellt man ein TechDraw Template

  • Erstelle ein neues Dokument in Inkscape
  • in den Dokumenteneigenschaften
    • wähle ein Papierformat (US Letter) sowie eine Orientierung (Querformat)
    • stelle die Standardeinheiten und Seitengrösseneinheit auf mm (279.4 x 215.9)



  • Zeichne die Rahmen, Ränder, Feldeinteilungen,usw.
  • Zeichne die Beschriftungsfelder
  • Erstelle und positioniere deinen statischen text
  • Erstelle und positioniere deinen veränderbaren (dynamischen) text
  • Nun solltest du ein Template ähnlich wie dieses haben:


  • Nimm den XML Editor um jedes veränderbares Textelement (<text>) auch als solches zu markieren ("freecad:editable")
    • vergib einen sinnvollen Namen für jedes Element


  • Nimm den XML Editor um die Viewbox der Papiergrösse in mm anzupassen


  • Das Template erscheint jetzt viel zu groß


  • Wir müssen es verkleinern
    • Bearbeiten>Alles in allen Ebenen auswählen (oder selektiere gründlich alles)
    • Passe die Höhe und Breite in mm so an, dass sie zu deiner Zeichnung passen.
      • Die Seite mit Seitenrand muss kleiner oder gleich der gewählten Papiergrösse sein.
    • verwende "Objekt > Ausrichten und Verteilen" oder die X/Y Bedienelemente falls notwendig.
    • Das Template sollte nun so wie das Beispiel oben aussehen.


  • Stelle sicher, dass alle editierbaren Textelemente nicht gruppiert sind. (shift-ctrl-g)
  • Markiere alles (Bearbeiten>Alles auswählen) und Bearbeiten>Kopieren
  • Ebene>aktuelle Ebene löschen
  • Bearbeiten>"An Originalposition einfügen"


  • Nun sollte das Template passen.
  • Speichere das Template
  • Probier es in FreeCAD aus.


2. In Document Properties

  • Select page size "US Letter" and orientation "landscape".
  • Set default units to "mm", and the page size to width "279.4" and height "215.9".

Inskcape: document with page size and orientation

3. Use the XML Editor to add a "freecad" namespace clause to the <svg> item.

Inkscape: XML Editor adding the "freecad" namespace clause to the <svg> item

Create template drawing

4. Draw outlines, zone numbers, center lines, and other geometry.

5. Draw the boxes and lines for the title block.

6. Add and position your static text.

7. Add and position the text that will be editable.

8. You now have your finished artwork, that should look something like this:

Inkscape: tentative template layout

Create editable fields

9. Use the XML Editor to add a freecad:editable tag to each editable <text> item.

  • Assign a meaningful field name to each editable text.

Inkscape: XML Editor adding the "freecad:editable" property to the desired <text> item

Adjust size of the SVG

10. Use the XML editor to adjust the viewBox attribute to match your page size in millimeters.

  • It is four values, in the format "0 0 width height"

Inkscape: XML Editor adjusting the viewbox to match the page size in millimeters

11. Your template will now appear much bigger than desired.

Inkscape: tentative template layout exceeding the page size

12. We need to shrink it.

  • Edit → Select All in All Layers, or box select and select all.
  • Adjust the W: and H: spinboxes to match your artwork's size in millimeters.
  • Set it to the page size less any applicable margins, for example, W: 250, and H: 200.

13. Use "Align and Distribute" or the X: and Y: spinboxes to position the artwork within the limits of the page if required.

14. Your template should now look right, just like it did in the finished artwork picture above.

Remove transformans on the SVG

15. Ensure that all your editable texts are "ungrouped" with Shift+Ctrl+g.

16. Select everything on your page, Edit → Select All, and then Edit → Copy.

17. Then delete the current layer, Layer → Delete Current Layer.

18. Then paste, Edit → Paste in Place.

19. Your template should now look right and shouldn't have any unwanted transforms.

20. Save your template.

21. Try it in FreeCAD and TechDraw Workbench with TechDraw New Pick.

FreeCAD: finished template with an editable text field being modified

Anmerkungen

Verwende keine Ebenen bevor du es nicht ohne Ebenen beherrscht. Ebenen und Gruppen können unerwünschte Transformationen verursachen.

See a Stackoverflow discussion on removing transform clauses in SVG files.