Draft Label/ro: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav|[[Draft CubicBezCurve|CubicBezCurve]]|[[Draft_Move|Move]]|[[Draft_Module|Draft]]|IconL=Draft CubicBezCurve.svg |IconC=Workbench_Draft.svg|IconR=Draft_Move.svg }}
{{Docnav
|[[Draft_Dimension|Dimension]]
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Dimension.svg
|IconR=Draft_AnnotationStyleEditor.svg
|IconC=Workbench_Draft.svg
}}


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
{{GuiCommand/ro
{{GuiCommand/ro|Name=Draft Label|Name/ro=Draft Label|Workbenches=[[Draft Module/ro|Draft]], [[Arch Module/ro|Arch]]|MenuLocation=Draft → Label|Shortcut=D L}}
|Name=Draft Label
|Name/ro=Draft Label
|MenuLocation=Draft → Label
|Workbenches=[[Draft_Workbench/ro|Draft]], [[Arch_Workbench/ro|Arch]]
|Shortcut={{KEY|D}} {{KEY|L}}
}}
</div>
</div>


<span id="Description"></span>
==Descriere==
==Descriere==


Line 12: Line 27:
</div>
</div>


If an object or a sub-element (face, edge or vertex) is selected when starting the command, the text can be made to display one or two attributes of the selected element, including position, length, area, volume and material. The text will then be linked to the attributes and will update if their values change.
To insert a simpler text element without an arrow use [[Draft Text]]. To create solid text shapes use [[Draft ShapeString]] with [[Part Extrude]].

To insert a text element without an arrow use the [[Draft_Text|Draft Text]] command instead.


[[Image:Draft_Label_example.jpg|400px]]
[[Image:Draft_Label_example.jpg|400px]]
Line 19: Line 36:
</div>
</div>


<span id="Usage"></span>
==How to use==
==How to use==

See also: [[Draft_Tray|Draft Tray]], [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
# Opțional, selectați un obiect sau un subelement al unui obiect (Vertex, margine sau fațetă)
# Opțional, selectați un obiect sau un subelement al unui obiect (Vertex, margine sau fațetă)
# Apăsați butonul {{KEY | [[Imagine: Schiță Label.png | 16px]] [[Etichetă de proiectare]]}} sau apăsați {{KEY | D}} apoi tastele {{KEY|L}}
# Apăsați butonul {{KEY | [[Image: Draft_Label.svg | 16px]] [[Draft_Label/ro|Etichetă de proiectare]]}} sau apăsați {{KEY | D}} apoi tastele {{KEY|L}}
# Faceți clic pe un prim punct al vizualizării 3D sau introduceți un [[Coordinate coordinate]] pentru a indica punctul țintă (poziția săgeții). Acest lucru poate fi oriunde, nu trebuie să fie exact pe elementul selectat
# Faceți clic pe un prim punct al vizualizării 3D sau introduceți un coordinate pentru a indica punctul țintă (poziția săgeții). Acest lucru poate fi oriunde, nu trebuie să fie exact pe elementul selectat
# Faceți clic pe un al doilea punct din vizualizarea 3D sau tastați un [[Draft_Coordinates | coordinate]] pentru a indica punctul intermediar care reprezintă începutul segmentului drept.
# Faceți clic pe un al doilea punct din vizualizarea 3D sau tastați un coordinate pentru a indica punctul intermediar care reprezintă începutul segmentului drept.
# Faceți clic pe un al treilea punct din vizualizarea 3D sau tastați un [[Draft_Coordinates | coordinate]] pentru a indica poziția textului.
# Faceți clic pe un al treilea punct din vizualizarea 3D sau tastați un coordinate pentru a indica poziția textului.
</div>
</div>


<span id="Options"></span>
{{emphasis|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.

{{emphasis|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.

== Opţiuni ==
== Opţiuni ==

The single character keyboard shortcuts available in the task panel can be changed. See [[Draft_Preferences|Draft Preferences]]. The shortcuts mentioned here are the default shortcuts.


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 42: Line 61:
</div>
</div>


<span id="Label_types"></span>
<div class="mw-translate-fuzzy">
== Tipuri de etichete ==
</div>

The following label types are available:

<div class="mw-translate-fuzzy">
* '''Custom''': Afișează conținutul proprietății text personalizat
* '''Name''': Afișează numele obiectului țintă
* '''Label''': Afișează eticheta obiectului țintă
* '''Poziția''': Afișează coordonatele obiectului țintă (punctul de bază al amplasamentului) sau coordonatele vârfului țintă, dacă este cazul, sau coordonatele centrului subelementului țintă (centrul de masă)
* '''Length''': Afișează lungimea subelementului țintă, dacă este posibil
* '''Area''': Arată suprafața subelementului țintă, dacă este posibil
* '''Volume''': Afișează volumul obiectului țintă, dacă este posibil
* '''Tag''': Afișează valoarea etichetei obiectului țintă, dacă obiectul țintă are o astfel de proprietate (ceea ce este cazul tuturor obiectelor Arch)
* '''Material''': Afișează eticheta materialului obiectului țintă, dacă obiectul țintă are o astfel de proprietate
</div>

==Notes==

* The direction of the second segment of the leader determines the alignment of the text. If the segment is horizontal and pointing to the right the text is aligned to the left and vice versa. If the second segment goes vertically up, the text is aligned to the left. If it goes vertically down, the text is aligned to the right.
* Draft Labels created or saved with [[Release_notes_0.21|FreeCAD version 0.21]] are not backward compatible.

<span id="Properties"></span>
==Proprietăți==
==Proprietăți==

See also: [[Property_editor|Property editor]].

A Draft Label object is derived from an [[App_FeaturePython|App FeaturePython]] object and inherits all its properties. The following properties are additional unless otherwise stated:

=== Data ===

{{TitleProperty|Label}}


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 62: Line 114:
</div>
</div>


{{TitleProperty|Leader}}
<div class="mw-translate-fuzzy">
== Tipuri de etichete ==
</div>


* {{PropertyData|Points|VectorList}}: specifies the points of the leader.
<div class="mw-translate-fuzzy">
* {{PropertyData|Straight Direction|Enumeration}}: specifies the direction of the first leader segment: {{Value|Custom}}, {{Value|Horizontal}} or {{Value|Vertical}}.
* '''Custom''': Afișează conținutul proprietății text personalizat
* {{PropertyData|Straight Distance|Distance}}: specifies the length of the first leader segment. Only used if {{PropertyData|Straight Direction}} is {{Value|Horizontal}} or {{Value|Vertical}}. If the distance is positive, the leader starts from the right side of the text and the text aligns to the right. Otherwise the leader starts from the left side of the text and the text aligns to the left.
* '''Name''': Afișează numele obiectului țintă

* '''Label''': Afișează eticheta obiectului țintă
{{TitleProperty|Target}}
* '''Poziția''': Afișează coordonatele obiectului țintă (punctul de bază al amplasamentului) sau coordonatele vârfului țintă, dacă este cazul, sau coordonatele centrului subelementului țintă (centrul de masă)

* '''Length''': Afișează lungimea subelementului țintă, dacă este posibil
* {{PropertyData|Target|LinkSub}}: specifies the object and optional subelement the label is linked to.
* '''Area''': Arată suprafața subelementului țintă, dacă este posibil
* {{PropertyData|Target Point|Vector}}: specifies the position of the tip of the leader, which is where the arrow is attached.
* '''Volume''': Afișează volumul obiectului țintă, dacă este posibil
* '''Tag''': Afișează valoarea etichetei obiectului țintă, dacă obiectul țintă are o astfel de proprietate (ceea ce este cazul tuturor obiectelor Arch)
* '''Material''': Afișează eticheta materialului obiectului țintă, dacă obiectul țintă are o astfel de proprietate
</div>


=== View ===
=== View ===

* {{PropertyView|Text 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.
{{TitleProperty|Annotation}}
* {{PropertyView|Text 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.

* {{PropertyView|Text Alignment}}: specifies the vertical alignment of the baseline of the text with respect to the leader. It can be top, middle or bottom.
* {{PropertyView|Text Color}}: specifies the color of the text in an RGB tuple (R, G, B).
* {{PropertyView|Annotation Style|Enumeration}}: specifies the annotation style applied to the label. See [[Draft_AnnotationStyleEditor|Draft AnnotationStyleEditor]].
* {{PropertyView|Line Width}}: specifies the width of the leader.
* {{PropertyView|Scale Multiplier|Float}}: specifies the general scaling factor applied to the label.

* {{PropertyView|Line Color}}: specifies the color of the leader.
{{TitleProperty|Display Options}}
* {{PropertyView|Arrow Size}}: specifies the size of the symbol displayed at the tip of the leader.

* {{PropertyView|Arrow Type}}: specifies the type of symbol displayed at the tip of the leader, which can be dot, circle, arrow, or tick.
* {{PropertyView|Display Mode|Enumeration}}: specifies how the text is displayed. If it is {{value|World}} the text will be displayed on a plane defined by the {{PropertyData|Placement}} of the label. If it is {{value|Screen}} the text will always face the screen. This is an inherited property. The mentioned options are the renamed options ({{Version|0.21}}).
* {{PropertyView|Frame}}: if it is "Rectangle" it will draw a frame around the text.

* {{PropertyView|Line}}: if it is {{TRUE}} the leader line will be displayed; otherwise only the text and the symbol at the tip will be displayed.
{{TitleProperty|Graphics}}
* {{PropertyView|Display 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.

* {{PropertyView|Arrow Size|Length}}: specifies the size of the symbol displayed at the tip of the leader.
* {{PropertyView|Arrow Type|Enumeration}}: specifies the type of symbol displayed at the tip of the leader, which can be {{value|Dot}}, {{value|Circle}}, {{value|Arrow}}, {{value|Tick}} or {{value|Tick-2}}.
* {{PropertyView|Frame|Enumeration}}: specifies what type of frame is drawn around the text. The current options are {{Value|None}} or {{Value|Rectangle}}.
* {{PropertyView|Line|Bool}}: specifies whether to display the leader line. If it is {{FALSE}} only the arrow and the text are displayed.
* {{PropertyView|Line Color|Color}}: specifies the color of the leader and the arrow. This is also used for the frame ({{Version|0.20}}).
* {{PropertyView|Line Width|Float}}: specifies the width of the leader. This is also used for the frame ({{Version|0.20}}).

{{TitleProperty|Text}}

* {{PropertyView|Font Name|Font}}: specifies the font used to draw the text. It can be a font name, such as {{value|Arial}}, a default style such as {{value|sans}}, {{value|serif}} or {{value|mono}}, a family such as {{value|Arial,Helvetica,sans}}, or a name with a style such as {{value|Arial:Bold}}. If the given font is not found on the system, a default font is used instead. {{Version|0.21}}
* {{PropertyView|Font Size|Length}}: specifies the size of the letters. The text can be invisible in the [[3D_view|3D view]] if this value is very small. {{Version|0.21}}
* {{PropertyView|Justification|Enumeration}}: specifies the horizontal alignment of the text: {{value|Left}}, {{value|Center}} or {{value|Right}}. Only used if {{PropertyData|Straight Direction}} is {{Value|Custom}}. Otherwise the horizontal alignment is based on the sign (positive or negative) of {{PropertyData|Straight Distance}}.
* {{PropertyView|Line Spacing|Float}}: specifies the factor applied to the default line height of the text.
* {{PropertyView|Max Chars|Integer}}: specifies the maximum number of characters on each line of the text.
* {{PropertyView|Text Alignment|Enumeration}}: specifies the vertical alignment of the text: {{value|Top}}, {{value|Middle}} or {{value|Bottom}}.
* {{PropertyView|Text Color|Color}}: specifies the color of the text.

==Scripting==


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 96: Line 162:
</div>
</div>


To create a Draft Label use the {{incode|make_label}} method ({{Version|0.19}}) of the Draft module. This method replaces the deprecated {{incode|makeLabel}} method.
The Label tool can be used in [[macros]] and from the [[Python]] console by using the following function:

{{Code|code=
{{Code|code=
label = make_label(target_point=App.Vector(0, 0, 0),
Label = makeLabel(targetpoint=None, target=None, direction=None, distance=None, labeltype=None, placement=None)
placement=App.Vector(30, 30, 0),
target_object=None, subelements=None,
label_type="Custom", custom_text="Label",
direction="Horizontal", distance=-10,
points=None)
}}
}}


Exempluː
<div class="mw-translate-fuzzy">
* Returnează obiectul nou creat.
</div>


{{Code|code=
Change the custom text by overwriting the {{incode|CustomText}} attribute. A list of strings can be used; each element will be displayed in its own line.
import FreeCAD as App
import Draft


doc = App.newDocument()
The view properties of {{incode|Label}} can be changed by overwriting its attributes; for example, overwrite {{incode|ViewObject.TextSize}} with the new size in millimeters.


rectangle = Draft.make_rectangle(4000, 1000)
Exempluː
doc.recompute()
{{Code|code=
import FreeCAD, Draft


Rectangle = Draft.makeRectangle(4000, 1000)
p1 = App.Vector(-200, 1000, 0)
place1 = App.Placement(App.Vector(-1000, 1300, 0), App.Rotation())


label1 = Draft.make_label(p1, place1, target_object=rectangle, distance=500, label_type="Label")
p1 = FreeCAD.Vector(-200, 1000, 0)
label1.ViewObject.FontSize= 200
place1 = FreeCAD.Placement(FreeCAD.Vector(-1000, 1300, 0), FreeCAD.Rotation())


p2 = App.Vector(-200, 0, 0)
Label1 = Draft.makeLabel(p1, Rectangle, "Horizontal", 500, "Label", place1)
place2 = App.Placement(App.Vector(-1000, -300, 0), App.Rotation())
Label1.ViewObject.TextSize = 200


label2 = Draft.make_label(p2, place2, target_object=rectangle, distance=500, label_type="Custom",
p2 = FreeCAD.Vector(-200, 0, 0)
custom_text="Beware of the sharp edges")
place2 = FreeCAD.Placement(FreeCAD.Vector(-1000, -300, 0), FreeCAD.Rotation())
label2.ViewObject.FontSize= 200


p3 = App.Vector(1000, 1200, 0)
Label2 = Draft.makeLabel(p2, Rectangle, "Horizontal", 500, "Custom", place2)
place3 = App.Placement(App.Vector(2000, 1800, 0), App.Rotation())
Label2.CustomText = ["Beware of the", "sharp edges"]
Label2.ViewObject.TextSize = 200
FreeCAD.ActiveDocument.recompute()


label3 = Draft.make_label(p3, place3, target_object=rectangle, distance=-500, label_type="Area")
p3 = FreeCAD.Vector(1000, 1200, 0)
label3.ViewObject.FontSize= 200
place3 = FreeCAD.Placement(FreeCAD.Vector(2000, 1800, 0), FreeCAD.Rotation())


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


{{Docnav|[[Draft CubicBezCurve|CubicBezCurve]]|[[Draft_Move|Move]]|[[Draft_Module|Draft]]|IconL=Draft CubicBezCurve.svg |IconC=Workbench_Draft.svg|IconR=Draft_Move.svg }}


{{Docnav
{{Draft Tools navi}}
|[[Draft_Dimension|Dimension]]
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Dimension.svg
|IconR=Draft_AnnotationStyleEditor.svg
|IconC=Workbench_Draft.svg
}}


{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 17:15, 7 April 2024

Draft Label

poziția meniului
Draft → Label
Ateliere
Draft, Arch
scurtătură
D L
Prezentat în versiune
-
A se vedea, de asemenea,
nici unul

Descriere

Acest instrument introduce o etichetă, care este o fragment de text cu o linie de 2 segmente și o săgeată, în documentul activ. Dacă se selectează un obiect sau un sub-element (față, muchie sau vârf) la pornirea comenzii, eticheta poate fi făcută să afișeze automat un anumit atribut al elementului selectat.

If an object or a sub-element (face, edge or vertex) is selected when starting the command, the text can be made to display one or two attributes of the selected element, including position, length, area, volume and material. The text will then be linked to the attributes and will update if their values change.

To insert a text element without an arrow use the Draft Text command instead.

How to use

See also: Draft Tray, Draft Snap and Draft Constrain.

  1. Opțional, selectați un obiect sau un subelement al unui obiect (Vertex, margine sau fațetă)
  2. Apăsați butonul Etichetă de proiectare sau apăsați D apoi tastele L
  3. Faceți clic pe un prim punct al vizualizării 3D sau introduceți un coordinate pentru a indica punctul țintă (poziția săgeții). Acest lucru poate fi oriunde, nu trebuie să fie exact pe elementul selectat
  4. Faceți clic pe un al doilea punct din vizualizarea 3D sau tastați un coordinate pentru a indica punctul intermediar care reprezintă începutul segmentului drept.
  5. Faceți clic pe un al treilea punct din vizualizarea 3D sau tastați un coordinate pentru a indica poziția textului.

Opţiuni

The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts.

  • Apăsând pe CTRL, snap punctul dvs. de locații disponibile snap.
  • Pentru a introduce manual coordonatele, pur și simplu introduceți numerele, apoi apăsați ENTER între fiecare componentă X, Y și Z.
  • Apăsând ESC se va anula operația.
  • Direcția segmentului drept (dreapta sau stânga) va justifica automat textul stânga sau dreapta.

Tipuri de etichete

The following label types are available:

  • Custom: Afișează conținutul proprietății text personalizat
  • Name: Afișează numele obiectului țintă
  • Label: Afișează eticheta obiectului țintă
  • Poziția: Afișează coordonatele obiectului țintă (punctul de bază al amplasamentului) sau coordonatele vârfului țintă, dacă este cazul, sau coordonatele centrului subelementului țintă (centrul de masă)
  • Length: Afișează lungimea subelementului țintă, dacă este posibil
  • Area: Arată suprafața subelementului țintă, dacă este posibil
  • Volume: Afișează volumul obiectului țintă, dacă este posibil
  • Tag: Afișează valoarea etichetei obiectului țintă, dacă obiectul țintă are o astfel de proprietate (ceea ce este cazul tuturor obiectelor Arch)
  • Material: Afișează eticheta materialului obiectului țintă, dacă obiectul țintă are o astfel de proprietate

Notes

  • The direction of the second segment of the leader determines the alignment of the text. If the segment is horizontal and pointing to the right the text is aligned to the left and vice versa. If the second segment goes vertically up, the text is aligned to the left. If it goes vertically down, the text is aligned to the right.
  • Draft Labels created or saved with FreeCAD version 0.21 are not backward compatible.

Proprietăți

See also: Property editor.

A Draft Label object is derived from an App FeaturePython object and inherits all its properties. The following properties are additional unless otherwise stated:

Data

Label

  • Date Tip de etichetă: tipul de informații afișate de această etichetă (vedeți mai jos)
  • Date Text personalizat: Textul care se afișează când tipul de etichetă este setat la personalizat
  • Date Placement: Indică rotația și poziția textului
  • Date Straight Distance: Lungimea segmentului drept
  • Date Direcție dreaptă: Direcția segmentului drept Orizontală sau verticală
  • Date Target Point: Punctul indicat de această etichetă
  • Vizualizare Text Size: Dimensiunea textului
  • Vizualizare Text Font: fontul folosit pentru text
  • Vizualizare Text Alignment: Alinierea verticală a textului: Sus, mijlocul sau partea de jos
  • Vizualizare Text Color: Culoarea textului
  • Vizualizare Lățime linie: Lățimea liniei
  • Vizualizare Line Color: culoarea liniei
  • Vizualizare Arrow Type: Tipul săgeții: Dot, cerc, săgeată sau bifați.
  • Vizualizare Dimensiunea săgeții: mărimea săgeții
  • Vizualizare Frame: Desenează un cadru în jurul textului

Leader

  • DatePoints (VectorList): specifies the points of the leader.
  • DateStraight Direction (Enumeration): specifies the direction of the first leader segment: Custom, Horizontal or Vertical.
  • DateStraight Distance (Distance): specifies the length of the first leader segment. Only used if DateStraight Direction is Horizontal or Vertical. If the distance is positive, the leader starts from the right side of the text and the text aligns to the right. Otherwise the leader starts from the left side of the text and the text aligns to the left.

Target

  • DateTarget (LinkSub): specifies the object and optional subelement the label is linked to.
  • DateTarget Point (Vector): specifies the position of the tip of the leader, which is where the arrow is attached.

View

Annotation

  • VizualizareAnnotation Style (Enumeration): specifies the annotation style applied to the label. See Draft AnnotationStyleEditor.
  • VizualizareScale Multiplier (Float): specifies the general scaling factor applied to the label.

Display Options

  • VizualizareDisplay Mode (Enumeration): specifies how the text is displayed. If it is World the text will be displayed on a plane defined by the DatePlacement of the label. If it is Screen the text will always face the screen. This is an inherited property. The mentioned options are the renamed options (introduced in version 0.21).

Graphics

  • VizualizareArrow Size (Length): specifies the size of the symbol displayed at the tip of the leader.
  • VizualizareArrow Type (Enumeration): specifies the type of symbol displayed at the tip of the leader, which can be Dot, Circle, Arrow, Tick or Tick-2.
  • VizualizareFrame (Enumeration): specifies what type of frame is drawn around the text. The current options are None or Rectangle.
  • VizualizareLine (Bool): specifies whether to display the leader line. If it is false only the arrow and the text are displayed.
  • VizualizareLine Color (Color): specifies the color of the leader and the arrow. This is also used for the frame (introduced in version 0.20).
  • VizualizareLine Width (Float): specifies the width of the leader. This is also used for the frame (introduced in version 0.20).

Text

  • VizualizareFont Name (Font): specifies the font used 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 default font is used instead. introduced in version 0.21
  • VizualizareFont Size (Length): specifies the size of the letters. The text can be invisible in the 3D view if this value is very small. introduced in version 0.21
  • VizualizareJustification (Enumeration): specifies the horizontal alignment of the text: Left, Center or Right. Only used if DateStraight Direction is Custom. Otherwise the horizontal alignment is based on the sign (positive or negative) of DateStraight Distance.
  • VizualizareLine Spacing (Float): specifies the factor applied to the default line height of the text.
  • VizualizareMax Chars (Integer): specifies the maximum number of characters on each line of the text.
  • VizualizareText Alignment (Enumeration): specifies the vertical alignment of the text: Top, Middle or Bottom.
  • VizualizareText Color (Color): specifies the color of the text.

Scripting

Script-Programare

Instrumentul Text poate fi utilizat în macros și din consola python utilizând următoarea funcție:

To create a Draft Label use the make_label method (introduced in version 0.19) of the Draft module. This method replaces the deprecated makeLabel method.

label = make_label(target_point=App.Vector(0, 0, 0),
                   placement=App.Vector(30, 30, 0),
                   target_object=None, subelements=None,
                   label_type="Custom", custom_text="Label",
                   direction="Horizontal", distance=-10,
                   points=None)

Exempluː

import FreeCAD as App
import Draft

doc = App.newDocument()

rectangle = Draft.make_rectangle(4000, 1000)
doc.recompute()

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

label1 = Draft.make_label(p1, place1, target_object=rectangle, distance=500, label_type="Label")
label1.ViewObject.FontSize= 200

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

label2 = Draft.make_label(p2, place2, target_object=rectangle, distance=500, label_type="Custom",
                          custom_text="Beware of the sharp edges")
label2.ViewObject.FontSize= 200

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

label3 = Draft.make_label(p3, place3, target_object=rectangle, distance=-500, label_type="Area")
label3.ViewObject.FontSize= 200

doc.recompute()