TechDraw TemplateHowTo/fr: Difference between revisions

From FreeCAD Documentation
No edit summary
(Created page with "Ce tutoriel explique comment créer un fichier SVG pouvant être utilisé comme arrière-plan modèle pour les pages de l'TechDraw Workb...")
Line 11: Line 11:
== Introduction ==
== Introduction ==


This tutorial shows you how to create an [[SVG]] file that can be used as the background [[TechDraw Templates|template]] for the [[TechDraw Workbench]] pages.
Ce tutoriel explique comment créer un fichier [[SVG/fr|SVG]] pouvant être utilisé comme arrière-plan [[TechDraw Templates/fr|modèle]] pour les pages de l'[[TechDraw Workbench/fr|Atelier Techdraw]].


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">

Revision as of 07:56, 17 August 2019

Other languages:
Tutoriel
Thème
Drafting
Niveau
Intermédiaire
Temps d'exécution estimé
60 minutes
Auteurs
wandererfan
Version de FreeCAD
0.17
Fichiers exemples
None
Voir aussi
None

Introduction

Ce tutoriel explique comment créer un fichier SVG pouvant être utilisé comme arrière-plan modèle pour les pages de l'Atelier Techdraw.

Ce manuel suppose que vous connaissez FreeCAD, Inkscape et Svg.

Nous allons créer un modèle simple pour le papier de format Lettre US en orientation paysage. Une copie du résultat de ce HowTo est disponible dans votre répertoire FreeCAD Template (HowToExample.svg).

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

Comment créer un modèle TechDraw

  • ouvrir un nouveau document dans Inkscape
  • dans les propriétés du document
    • sélectionnez une taille de page (lettre US) et l'orientation (paysage)
    • définir les unités par défaut et les unités de taille de page en mm (279,4 x 215,9)



  • dessiner des contours, des numéros de zone, des axes, etc.
  • dessine les cases et les lignes pour le cartouche.
  • ajouter et positionner votre texte statique
  • ajoutez et positionnez votre texte éditable
  • vous avez maintenant votre œuvre terminée - quelque chose comme ceci:


  • utiliser l'éditeur XML pour ajouter une balise "freecad: editable" à chaque élément <text> éditable
    • attribuer un nom de champ significatif à chaque texte modifiable


  • utilisez l'éditeur XML pour ajuster la vue pour qu'elle corresponde à la taille de votre page en mm


  • Votre modèle apparaîtra maintenant beaucoup trop grand.


  • Nous devons le réduire.
    • Modifier> Sélectionner tout dans tous les calques (ou sélectionner la case pour s'assurer de tout sélectionner)
    • ajuster les W: et H: spinboxes pour correspondre à la taille de votre œuvre en mm
      • taille de la page moins les marges applicables
    • utilisez les boîtes de sélection "Aligner et distribuer" ou X / Y pour positionner l'illustration sur la page si nécessaire.
    • Votre modèle devrait maintenant avoir l'air juste, comme il l'a fait dans l'image d'art fini ci-dessus.


  • Assurez-vous que tous vos textes modifiables sont "dissociés" (shift-ctl-g)
  • sélectionnez tout sur votre page (zone de sélection ou Modifier> Sélectionner tout) et Edition> Copier
  • Calque> Supprimer le calque courant
  • Modifier> Coller sur place


  • Votre modèle devrait maintenant regarder à droite et ne devrait pas avoir de transformations indésirables
  • Enregistrez votre modèle
  • Essayez-le dans FreeCAD.


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

Notes

- N'utilisez pas les calques tant que vous n'avez pas maîtrisé la création de modèles sans eux. Les calques (et les groupes) peuvent automatiquement insérer des transformations indésirables dans votre fichier SVG.

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