Rysunek Roboczy: Edytor stylu opisu
Draft AnnotationStyleEditor |
Menu location |
---|
Annotation → Annotation styles... |
Workbenches |
Draft |
Default shortcut |
None |
Introduced in version |
0.19 |
See also |
Draft Text, Draft Label, Draft Dimension |
Description
The Draft AnnotationStyleEditor command allows you to define styles that affect the visual properties of annotation-like objects, such as those create by the Draft Text, Draft Dimension and Draft Label commands.
introduced in version 0.21: Several bugs have been fixed and a separate Text color button has been added.
The Annotation Styles Editor dialog box
Usage
- There are several ways to invoke the command:
- Press the Draft AnnotationStyleEditor button.
- Select the Annotation → Annotation styles... option from the menu.
- The Annotation Styles Editor dialog box opens.
- Select a style from the Style name dropdown list, or choose
Add new...
to define a new style. - Optionally adjust the properties of the style.
- Optionally press the Rename button to rename the style.
- Optionally press the Delete button to delete the style.
- Optionally press the button to import all styles from a .json file. This will overwrite existing styles with the same name.
- Optionally press the button to export all styles to a .json file.
- Press the OK button to close the dialog box and finish the command.
Scripting
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
introduced in version 0.21: The information in this paragraph has been updated and reflects FreeCAD version 0.21.
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_Text red"])
{"FontName": "DejaVu Sans", "FontSize": 10.0, "LineSpacing": 1.0, "TextColor": 4278190335, "ScaleMultiplier": 1.0, "ShowUnit": false, "UnitOverride": "", "Decimals": 2, "ShowLine": true, "LineWidth": 2, "ArrowType": 0, "ArrowSize": 2.0, "LineColor": 255, "DimOvershoot": 0.0, "ExtLines": 0.0, "ExtOvershoot": 4.0}
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.0}
meta["Draft_Style_Thick_lines"] = json.dumps(props)
App.ActiveDocument.Meta = meta
The properties not entered will be filled automatically when this style is selected in the style editor and the OK button is pressed.
In a similar way, any serialized dictionary can be unpacked for edition.
import json
meta = App.ActiveDocument.Meta
new_dict = json.loads(meta["Draft_Style_Thick_lines"])
The properties must have the following types:
Strings:
props = {
"FontName": "DejaVu Sans",
"UnitOverride": ""
}
Floats (must be supplied with a decimal point):
props = {
"FontSize": 10.0,
"LineSpacing": 1.0,
"ScaleMultiplier": 1.0,
"ArrowSize": 2.0,
"DimOvershoot": 0.0,
"ExtLines": 0.0,
"ExtOvershoot": 4.0
}
Integers:
props = {
"TextColor": 4278190335,
"Decimals": 2,
"LineWidth": 2,
"ArrowType": 0,
"LineColor": 255
}
The TextColor
and LineColor
correspond to a 32-bit integer, from which the individual RGBA values can be extracted. The ArrowType
is an enumerator.
Booleans:
props = {
"ShowUnit": false,
"ShowLine": true
}
- Kreślenie: Linia, Polilinia, Zaokrąglenie, Łuk, Łuk przez 3 punkty, Okrąg, Elipsa, Wielokąt foremny, Krzywa złożona, Krzywa Bezier'a, Punkt, Łącznik ścian, Kształt z tekstu, Kreskowanie, Prostokąt
- Adnotacje: Adnotacja wieloliniowa, Wymiarowanie, Etykieta, Edytor stylów adnotacji, Widżet skali anotacji
- Modyfikacja: Przesuń, Obróć, Skala, Odbicie lustrzane, Odsunięcie, Przytnij, Rozciągnij, Klonuj, Szyk, Szyk biegunowy, Szyk kołowy, Szyk po ścieżce, Szyk powiązań po ścieżce, Szyk z punktów, Szyk powiązań w punktach, Edycja, Podświetl element podrzędny, Połącz, Rozdziel, Ulepsz kształt, Rozbij obiekt na elementy, Polilinia na krzywą złożoną, Rysunek Roboczy do szkicu, Nachylenie, Obróć wymiar, Widok 2D kształtu
- Tacka narzędziowa: Wybór płaszczyzny, Ustaw styl, Przełącz tryb konstrukcyjny, Grupowanie automatyczne
- Przyciąganie: Przełącz przyciąganie, Przyciągnij do punktu końcowego, Przyciągnij do punktu środkowego, Przyciągnij do środka, Przyciągnij do kąta, Przyciąganie do punktu przecięcia, Przyciągnij prostopadle, Rozszerz, Przyciągnij równolegle, Przyciągnij specjalnie, Przyciąganie do najbliższego, Przyciągnij ortogonalnie, Przyciągnij do siatki, Przyciągnij do płaszczyzny roboczej, Przyciągnij do wymiaru, Pokaż / ukryj siatkę
- Różności: Zastosuj bieżący styl, Warstwa, Zarządzaj warstwami, Dodaj grupę o nazwie, Dodaj do grupy, Wybierz grupę, Dodaj do grupy konstrukcyjnej, Przełącz tryb wyświetlania, Pośrednia płaszczyzna robocza, Ulecz, Przełącz tryb kontynuacji, Pokaż przybornik przyciągania
- Dodatkowe:: Wiązania, Wypełnienie wzorem, Preferencje, Ustawienia Importu i Eksportu, DXF/DWG, SVG, OCA, DAT
- Menu podręczne:
- Kontener warstwy: Połącz duplikaty warstw, Dodaj warstwę
- Warstwa: Aktywuj warstwę, Zaznacz zawartość warstwy
- Pośrednia płaszczyzna robocza: Zapisz ujęcie widoku, Zapisz stan obiektów
- Jak zacząć
- Instalacja: Pobieranie programu, Windows, Linux, Mac, Dodatkowych komponentów, Docker, AppImage, Ubuntu Snap
- Podstawy: Informacje na temat FreeCAD, Interfejs użytkownika, Profil nawigacji myszką, Metody wyboru, Nazwa obiektu, Edytor ustawień, Środowiska pracy, Struktura dokumentu, Właściwości, Pomóż w rozwoju FreeCAD, Dotacje
- Pomoc: Poradniki, Wideo poradniki
- Środowiska pracy: Strona Startowa, Architektura, Assembly, CAM, Rysunek Roboczy, MES, Inspekcja, Siatka, OpenSCAD, Część, Projekt Części, Punkty, Inżynieria Wsteczna, Robot, Szkicownik, Arkusz Kalkulacyjny, Powierzchnia 3D, Rysunek Techniczny, Test Framework