Draft Éditeur de styles d'annotations
Draft Editeur styles d'annotations |
Emplacement du menu |
---|
Annotation → Annotation styles |
Ateliers |
Draft |
Raccourci par défaut |
Aucun |
Introduit dans la version |
0.19 |
Voir aussi |
Draft Texte, Draft Dimension, Draft Etiquette |
Description
The Annotation style editor tool allows you to define styles that affect the visual properties of annotation-like objects, like those create by Text, Dimension, and Label.
File:Draft AnnotationStyleEditor example.png
Style editor to configure the annotations.
Usage
- Press Draft Annotation style editor button.
- Open the combobox, and then choose Add new... to define a new style, or select one of the existing styles.
- Adjust the properties of the style, and then press OK when satisfied.
Use the Rename or Delete to rename or delete the active style.
Scripting
The annotation styles are saved as serialized dictionaries in the Meta
attribute of the document. This attribute is inspected by the annotation style editor when it is opened.
>>> print(App.ActiveDocument.Meta["Draft_Style_Lane 1:100"])
{"FontName": "DejaVu Sans", "FontSize": "8.0000 ", "LineSpacing": "1 cm", "ScaleMultiplier": 1.0, "ShowUnit": false, "UnitOverride": "", "Decimals": 2, "ShowLines": true, "LineWidth": 2, "LineColor": 1095216660480, "ArrowType": 0, "ArrowSize": "5.0000 ", "DimensionOvershoot": "1.0000 ", "ExtensionLines": "5.0000 ", "ExtensionOvershoot": "1.0000 "}
Each style that appears in the editor is internally saved with the style name prefixed by Draft_Style_
; this will prevent name clashes with other keys that may be saved in Meta
, which can hold arbitrary information.
You may define any new style by adding the necessary information to a key that starts with Draft_Style_
. The corresponding value of this key must be a dictionary serialized using json
.
import json
meta = App.ActiveDocument.Meta
props = {"LineWidth": 6, "ArrowSize": "7"}
meta["Draft_Style_Thick_lines"] = json.dumps(props)
App.ActiveDocument.Meta = meta
The values not entered will be filled automatically when this style is selected in the style editor.
In a similar way, any serialized dictionary can be unpacked for edition.
meta = App.ActiveDocument.Meta
new_dict = json.loads(meta["Draft_Style_Thick_lines"])
Because the graphical interface widgets check the units of the input values, many of these values must be saved as strings, rather than floating point numbers.
Strings:
props = {
"FontName": "DejaVu Sans",
"FontSize": "12.0000 ",
"LineSpacing": "1 cm",
"UnitOverride": "m",
"ArrowSize": "5.0000 ",
"DimensionOvershoot": "1.0000 ",
"ExtensionLines": "5.0000 ",
"ExtensionOvershoot": "1.0000 "
}
Numbers:
props = {
"ScaleMultiplier": 1.0,
"Decimals": 2,
"LineWidth": 1,
"LineColor": 1095216660480,
"ArrowType": 0
}
The line color corresponds to the 32-bit integer, from which the individual RGBA values can be extracted.
Boolean:
props = {
"ShowUnit": False,
"ShowLines": True
}
- Drafting : Ligne, Polyligne, Congé, Arc, Arc par 3 points, Cercle, Ellipse, Rectangle, Polygone, B-spline, Courbe de Bézier cubique, Courbe de Bézier, Point, Surfaces liées, Formes à partir de texte, Hachure
- Annotation : Texte, Dimension, Étiquette, Éditeur de styles d'annotations, Widget d'échelle d'annotation.
- Modification : Déplacer,Pivoter,Échelle,Miroir, Décalage, Ajuster ou prolonger, Étirer, Cloner, Réseau orthogonal, Réseau polaire, Réseau circulaire, Réseau selon une courbe, Réseau lié selon une courbe, Réseau de points, Réseau lié selon des points, Éditer, Surligner les sous éléments, Joindre, Scinder, Agréger, Désagréger, Polyligne vers B-spline, Draft vers esquisse, Pente, Inverser le texte de la dimension, Vue 2D d'une forme
- Barre Draft : Plan de travail, Définir le style, Basculer en mode construction, Groupement automatique
- Aimantation : Verrouillage de l'aimantation, Aimantation terminaison, Aimantation milieu, Aimantation centre, Aimantation angle, Aimantation intersection, Aimantation perpendiculaire, Aimantation extension, Aimantation parallèle, Aimantation spéciale, Aimantation au plus proche, Aimantation orthogonal, Aimantation grille, Aimantation plan de travail, Aimantation dimensions, Basculer la grille
- Utilitaires : Appliquer le style, Calque, Gestionnaire de calques, Nommer un groupe, Déplacer vers un groupe, Sélection groupée, Ajouter au groupe de construction, Mode d'affichage, Proxy de plan de travail, Réparer, Barre d'aimantation
- Additionnels : Contrainte, Motif, Préférences, Préférences d'Import Export, DXF/DWG, SVG, OCA, DAT
- Menu contextuel :
- Conteneur du calque : Fusionner les calques en double, Ajouter un nouveau calque
- Calque : Groupement automatique, Sélection groupée
- Texte : Ouvir les hyperliens
- Filaire : Aplatir
- Proxy de plan de travail : Enregistrer la position de la caméra, Enregistrer l'état des objets
- Démarrer avec FreeCAD
- Installation : Téléchargements, Windows, Linux, Mac, Logiciels supplémentaires, Docker, AppImage, Ubuntu Snap
- Bases : À propos de FreeCAD, Interface, Navigation par la souris, Méthodes de sélection, Objet name, Préférences, Ateliers, Structure du document, Propriétés, Contribuer à FreeCAD, Faire un don
- Aide : Tutoriels, Tutoriels vidéo
- Ateliers : Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test