Draft Étiquette

From FreeCAD Documentation
Revision as of 15:10, 6 March 2019 by Jpg87 (talk | contribs)

Label

Emplacement du menu
Draft → Label
Ateliers
Draft, Arch
Raccourci par défaut
D L
Introduit dans la version
0.17
Voir aussi
Draft Text, Draft ShapeString

Description

L'outil Label (Étiquette) insère une zone de texte multi-ligne avec une ligne de repère à 2 segments et une flèche. Si un objet ou un sous-élément (face, arête ou sommet) est sélectionné lors du lancement de la commande, l'étiquette peut afficher un certain attribut de l'élément sélectionné, notamment la position, la longueur, la surface, le volume ou le matériau.

Pour insérer un élément de texte plus simple sans flèche, utilisez Draft Texte. Pour créer des formes de texte solides, utilisez Draft ShapeString avec Part Extruder.

Différentes étiquettes avec des orientations différentes, des symboles d'extrémités et des informations

Utilisation

  1. Facultativement, sélectionnez un objet ou un sous-élément d'un objet (sommet, arête ou face)
  2. Appuyez sur la touche , ou appuyez sur les touches D puis L.
  3. Cliquez sur un premier point de la vue 3D ou tapez une coordinate pour indiquer le point cible (position de la flèche). Cela peut être n'importe où, il n'est pas nécessaire que ce soit exactement sur l'élément sélectionné
  4. Cliquez sur un deuxième point de la vue 3D ou tapez une coordinate pour indiquer le point central qui correspond au début du segment de droite.
  5. Cliquez sur un troisième point de la vue 3D ou tapez une coordinate, pour indiquer la position du texte.

Note: the direction of the horizontal straight segment, to the right or to the left, will automatically align the text to the opposite direction. If the leader goes vertically up, the text is aligned to the left; if it goes vertically down, it is aligned to the right.

Note 2: by pre-selecting an object, or a sub-element (vertex, edge or face), before pressing the tool button, the label will become parametric, that is, it will remember which object it is bound to, and it will be able to display a particular attribute of that object. If the attributes of the object change later on, the label will adjust the displayed information.

Options

  • Appuyez sur CTRL pour que snap pointe sur les emplacements de capture disponibles.
  • Pour entrer les coordonnées manuellement, entrez simplement les nombres, puis appuyez sur ENTER entre chaque composante X, Y et Z.
  • Appuyez sur ESC pour annuler l'opération.
  • La direction du segment de droite (droite ou gauche) justifiera automatiquement le texte à gauche ou à droite.

Propriétés

  • Données Type d'étiquette: Le type d'information indiqué par cette étiquette (voir ci-dessous)
  • Données Custom Text: texte à afficher lorsque le type d'étiquette est défini sur custom
  • Données Placement: Indique la rotation et la position du texte.
  • Données Straight Distance: la longueur du segment de droite
  • Données Direction droite: direction du segment de droite, horizontal ou vertical
  • Données Target Point: Le point indiqué par cette étiquette
  • Vue Text Size: La taille du texte
  • Vue Text Font: la police utilisée pour le texte.
  • Vue Text Alignment: l'alignement vertical du texte: haut, milieu ou bas
  • Vue Couleur du texte: La couleur du texte
  • Vue Line Width: La largeur de la ligne
  • Vue Line Line: La couleur de la ligne
  • Vue Type de flèche: type de la flèche: point, cercle, flèche ou tick.
  • Vue Arrow Size: La taille de la flèche
  • Vue Frame: Dessine un cadre autour du texte.

Types d'étiquettes

  • Custom: Affiche le contenu de la propriété Custom Text
  • Nom: Affiche le nom de l'objet cible
  • Label: Affiche le label de l'objet cible
  • Position: affiche les coordonnées de l'objet cible (point de base de l'emplacement), ou les coordonnées du sommet cible, le cas échéant, ou les coordonnées du centre du sous-élément cible (centre de gravité)
  • Longueur: Affiche la longueur du sous-élément cible, si possible
  • Area: affiche la zone du sous-élément cible, si possible
  • Volume: Affiche le volume de l'objet cible, si possible
  • Tag: Affiche la valeur de la balise de l'objet cible, si l'objet cible a une telle propriété (ce qui est le cas de tous les objets Arch).
  • Material: Affiche l'étiquette du matériau de l'objet cible, si celui-ci a cette propriété.

View

  • VueText Font: specifies the font to use to draw the text. It can be a font name, such as "Arial", a default style such as "sans", "serif" or "mono", a family such as "Arial,Helvetica,sans" or a name with a style such as "Arial:Bold". If the given font is not found on the system, a generic one is used instead.
  • VueText Size: specifies the size of the text. If the label object is created in the tree view but no text is visible in the 3D view, increase the size of the text until it is visible.
  • VueText Alignment: specifies the vertical alignment of the baseline of the text with respect to the leader. It can be top, middle or bottom.
  • VueText Color: specifies the color of the text in an RGB tuple (R, G, B).
  • VueLine Width: specifies the width of the leader.
  • VueLine Color: specifies the color of the leader.
  • VueArrow Size: specifies the size of the symbol displayed at the tip of the leader.
  • VueArrow Type: specifies the type of symbol displayed at the tip of the leader, which can be dot, circle, arrow, or tick.
  • VueFrame: if it is "Rectangle" it will draw a frame around the text.
  • VueLine: if it is true the leader line will be displayed; otherwise only the text and the symbol at the tip will be displayed.
  • VueDisplay Mode: if it is "3D text" the text will be aligned to the scene axes, initially lying on the XY plane; if it is "2D text" the text will always face the camera.

Script

L'outil texte peut être utilisé dans les macros, et dans la console Python, en utilisant la fonction suivante :

The Label tool can be used in macros and from the Python console by using the following function:

Label = makeLabel(targetpoint=None, target=None, direction=None, distance=None, labeltype=None, placement=None)
  • Retourne le nouvel objet créé.

Change the custom text by overwriting the CustomText attribute. A list of strings can be used; each element will be displayed in its own line.

The view properties of Label can be changed by overwriting its attributes; for example, overwrite ViewObject.TextSize with the new size in millimeters.

Exemple:

import FreeCAD, Draft

Rectangle = Draft.makeRectangle(4000, 1000)

p1 = FreeCAD.Vector(-200, 1000, 0)
place1 = FreeCAD.Placement(FreeCAD.Vector(-1000, 1300, 0), FreeCAD.Rotation())

Label1 = Draft.makeLabel(p1, Rectangle, "Horizontal", 500, "Label", place1)
Label1.ViewObject.TextSize = 200

p2 = FreeCAD.Vector(-200, 0, 0)
place2 = FreeCAD.Placement(FreeCAD.Vector(-1000, -300, 0), FreeCAD.Rotation())

Label2 = Draft.makeLabel(p2, Rectangle, "Horizontal", 500, "Custom", place2)
Label2.CustomText = ["Beware of the", "sharp edges"]
Label2.ViewObject.TextSize = 200
FreeCAD.ActiveDocument.recompute()

p3 = FreeCAD.Vector(1000, 1200, 0)
place3 = FreeCAD.Placement(FreeCAD.Vector(2000, 1800, 0), FreeCAD.Rotation())

Label3 = Draft.makeLabel(p3, Rectangle, "Horizontal", -500, "Area", place3)
Label3.ViewObject.TextSize = 200
FreeCAD.ActiveDocument.recompute()