Draft Label/es: Difference between revisions

From FreeCAD Documentation
(Created page with "Draft Label/es")
 
(Updating to match new version of source page)
 
(30 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{GuiCommand|Name=Draft Label|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft → Label|Shortcut=D L}}


{{Docnav
==Description==
|[[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">
{{GuiCommand/es
|Name=Draft Label
|Name/es=Draft Label
|Workbenches=[[Draft_Workbench/es|Draft]], [[Arch_Workbench/es|Arch]]
|MenuLocation=Draft → Label
|Shortcut=D L
}}
</div>

<span id="Description"></span>
==Descripción==

<div class="mw-translate-fuzzy">
Esta herramienta inserta una etiqueta, que es un fragmento de texto con una línea de 2 segmentos y una flecha, en el documento activo. Si se selecciona un objeto o un subelemento (cara, borde o vértice) al iniciar el comando, se puede hacer que la Etiqueta muestre automáticamente un determinado atributo del elemento seleccionado.
</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 text element without an arrow use the [[Draft_Text|Draft Text]] command instead.
This tool inserts a label, which is a piece of text with a 2-segment line and an arrow, in the active document. If an object or a sub-element (face, edge or vertex) is selected when starting the command, the Label can be made to automatically display a certain attribute of the selected element.


[[Image:Draft_Label_example.jpg|400px]]
[[Image:Draft_Label_example.jpg|400px]]
<div class="mw-translate-fuzzy">
[[Image:Draft_Label_example.jpg|400px]]
</div>


<span id="Usage"></span>
==How to use==
==Utilización==


See also: [[Draft_Tray|Draft Tray]], [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].
# Optionally, select an object or a subelement of an object (Vertex, edge or face)

# Press the {{KEY|[[Image:Draft Label.png|16px]] [[Draft Label]]}} button, or press {{KEY|D}} then {{KEY|L}} keys
# Optionally select an object or a sub-element (vertex, edge or face) that you want to display attributes of.
# Click a first point on the 3D view, or type a [[Draft_Coordinates|coordinate]], to indicate the target point (arrow position). This can be anywhere, it doesn't need to be exactly on the selected element
# There are several ways to invoke the command:
# Click a second point on the 3D view, or type a [[Draft_Coordinates|coordinate]], to indicate the middle point that is the start of the straight segment.
#* Press the {{Button|[[Image:Draft_Label.svg|16px]] [[Draft_Label|Label]]}} button.
# Click a third point on the 3D view, or type a [[Draft_Coordinates|coordinate]], to indicate the position of the text.
#* Select the {{MenuCommand|Annotation → [[Image:Draft_Label.svg|16px]] Label}} option from the menu.
#* Use the keyboard shortcut: {{KEY|D}} then {{KEY|L}}.
# The {{MenuCommand|Label}} task panel opens. See [[#Options|Options]] for more information.
# If you have selected an element: select an option from the {{MenuCommand|Label type}} dropdown list. See [[#Label_types|Label types]] below.
# Pick the first point in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button. This point indicates the target (arrow head). This can be anywhere, it does not have to be on an element.
# Pick the second point in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button. This point indicates the start of the horizontal or vertical segment of the leader.
# Pick the third point in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button. This point indicates the base point of the text.


==Options==
==Options==


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.
* Pressing {{KEY|CTRL}} will [[Draft_Snap|snap]] your point to available snap locations.

* To enter coordinates manually, simply enter the numbers, then press {{KEY|ENTER}} between each X, Y and Z component.
* To manually enter coordinates enter the X, Y and Z component, and press {{KEY|Enter}} after each. Or you can press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button when you have the desired values. It is advisable to move the pointer out of the [[3D_view|3D view]] before entering coordinates.
* Pressing {{KEY|ESC}} will cancel the operation.
* Press {{KEY|R}} or click the {{MenuCommand|Relative}} checkbox to toggle relative mode. If relative mode is on, coordinates are relative to the last point, if available, else they are relative to the coordinate system origin.
* The direction of the straight segment (right or left) will automatically justify the text left or right.
* Press {{KEY|G}} or click the {{MenuCommand|Global}} checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the [[Draft_SelectPlane|working plane]] coordinate system. {{Version|0.20}}
* Press {{KEY|S}} to switch [[Draft_Snap|Draft snapping]] on or off.
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the command.

== Label types ==

The following label types are available:

* {{Value|Custom}}: displays the contents of {{PropertyData|Custom Text}}.
* {{Value|Name}}: displays the internal name of the target object. The internal name is assigned when an object is created and remains fixed throughout the existence of the object.
* {{Value|Label}}: displays the label of the target object. The label of an object can be changed by the user.
* {{Value|Position}}: displays the coordinates of the base point of the target object or of the target vertex.
* {{Value|Length}}: displays the length of the target object or subelement.
* {{Value|Area}}: displays the area of the target object or subelement.
* {{Value|Volume}}: displays the volume of the target object.
* {{Value|Tag}}: displays the {{incode|Tag}} attribute of the target object. Objects created with the [[Arch_Workbench|Arch Workbench]] can have this attribute.
* {{Value|Material}}: displays the label of the material of the target object.
* {{Value|Label + Position}}
* {{Value|Label + Length}}
* {{Value|Label + Area}}
* {{Value|Label + Volume}}
* {{Value|Label + Material}}

==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.


==Properties==
==Properties==


See also: [[Property_editor|Property editor]].
* {{PropertyData|Label Type}}: The type of information shown by this label (see below)
* {{PropertyData|Custom Text}}: The text to display when Label Type is set to custom
* {{PropertyData|Placement}}: Indicates the rotation and the position of the text
* {{PropertyData|Straight Distance}}: The length of the straight segment
* {{PropertyData|Straight Direction}}: The direction of the straight segment Horizontal or vertical
* {{PropertyData|Target Point}}: The point indicated by this label
* {{PropertyView|Text Size}}: The size of the text
* {{PropertyView|Text Font}}: The font used for the text
* {{PropertyView|Text Alignment}}: The vertical alignment of the text: Top, middle or bottom
* {{PropertyView|Text Color}}: The color of the text
* {{PropertyView|Line Width}}: The width of the line
* {{PropertyView|Line Color}}: The color of the line
* {{PropertyView|Arrow Type}}: The type of the arrow: Dot, circle, arrow or tick.
* {{PropertyView|Arrow Size}}: The size of the arrow
* {{PropertyView|Frame}}: Draws a frame around the text


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:
== Label types ==


=== Data ===
* '''Custom''': Shows the contents of the Custom Text property

* '''Name''': Shows the name of the target object
{{TitleProperty|Label}}
* '''Label''': Shows the label of the target object

* '''Position''': Shows the coordinates of the target object (Placement base point), or the coordinates of the target vertex, if applicable, or the coordinates of the center of the target subelement (center of mass)
* {{PropertyData|Custom Text|StringList}}: specifies the contents of the text if {{PropertyData|Label Type}} is {{Value|Custom}}. Each item in the list represents a new text line.
* '''Length''': Shows the length of the target subelement, if possible
* {{PropertyData|Label Type|Enumeration}}: specifies the type of information displayed by the label. See [[#Label_types|Label types]].
* '''Area''': Shows the area of the target subelement, if possible
* {{PropertyData|Placement|Placement}}: specifies the position of the text in the [[3D view|3D view]] and, unless {{PropertyData|Straight Direction}} is {{Value|Custom}}, also of the first leader segment, which is the segment where the text is attached. See [[Placement|Placement]].
* '''Volume''': Shows the volume of the target object, if possible
* {{PropertyData|Text|StringList}}: (read-only) specifies the contents of the text that is actually displayed. Each item in the list represents a new text line.
* '''Tag''': Shows the tag value of the target object, if the target object has such property (which is the case of all Arch objects)

* '''Material''': Shows the label of the material of the target object, if the target object has such property
{{TitleProperty|Leader}}

* {{PropertyData|Points|VectorList}}: specifies the points of the leader.
* {{PropertyData|Straight Direction|Enumeration}}: specifies the direction of the first leader segment: {{Value|Custom}}, {{Value|Horizontal}} or {{Value|Vertical}}.
* {{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.

{{TitleProperty|Target}}

* {{PropertyData|Target|LinkSub}}: specifies the object and optional subelement the label is linked to.
* {{PropertyData|Target Point|Vector}}: specifies the position of the tip of the leader, which is where the arrow is attached.

=== View ===

{{TitleProperty|Annotation}}

* {{PropertyView|Annotation Style|Enumeration}}: specifies the annotation style applied to the label. See [[Draft_AnnotationStyleEditor|Draft AnnotationStyleEditor]].
* {{PropertyView|Scale Multiplier|Float}}: specifies the general scaling factor applied to the label.

{{TitleProperty|Display Options}}

* {{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}}).

{{TitleProperty|Graphics}}

* {{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==
==Scripting==

The Text tool can by used in [[macros]] and from the python console by using the following function:
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].

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.

{{Code|code=
{{Code|code=
label = make_label(target_point=App.Vector(0, 0, 0),
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)
}}
}}


Ejemplo:
* Returns the newly created object.


Example:
{{Code|code=
{{Code|code=
import FreeCAD,Draft
import FreeCAD as App
import Draft
selection = FreeCADGui.Selection.getSelectionEx()[0]

Draft.makeLabel(FreeCAD.Vector(10,-10,0),selection,"Horizontal",20,"Label")
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()
}}


{{Docnav
|[[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:}}}}
{{clear}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 17:15, 7 April 2024

Draft Label

Ubicación en el Menú
Draft → Label
Entornos de trabajo
Draft, Arch
Atajo de teclado por defecto
D L
Introducido en versión
-
Ver también
Ninguno

Descripción

Esta herramienta inserta una etiqueta, que es un fragmento de texto con una línea de 2 segmentos y una flecha, en el documento activo. Si se selecciona un objeto o un subelemento (cara, borde o vértice) al iniciar el comando, se puede hacer que la Etiqueta muestre automáticamente un determinado atributo del elemento seleccionado.

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.

Utilización

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

  1. Optionally select an object or a sub-element (vertex, edge or face) that you want to display attributes of.
  2. There are several ways to invoke the command:
    • Press the Label button.
    • Select the Annotation → Label option from the menu.
    • Use the keyboard shortcut: D then L.
  3. The Label task panel opens. See Options for more information.
  4. If you have selected an element: select an option from the Label type dropdown list. See Label types below.
  5. Pick the first point in the 3D view, or type coordinates and press the Enter point button. This point indicates the target (arrow head). This can be anywhere, it does not have to be on an element.
  6. Pick the second point in the 3D view, or type coordinates and press the Enter point button. This point indicates the start of the horizontal or vertical segment of the leader.
  7. Pick the third point in the 3D view, or type coordinates and press the Enter point button. This point indicates the base point of the text.

Options

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

  • To manually enter coordinates enter the X, Y and Z component, and press Enter after each. Or you can press the Enter point button when you have the desired values. It is advisable to move the pointer out of the 3D view before entering coordinates.
  • Press R or click the Relative checkbox to toggle relative mode. If relative mode is on, coordinates are relative to the last point, if available, else they are relative to the coordinate system origin.
  • Press G or click the Global checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the working plane coordinate system. introduced in version 0.20
  • Press S to switch Draft snapping on or off.
  • Press Esc or the Close button to abort the command.

Label types

The following label types are available:

  • Custom: displays the contents of DatosCustom Text.
  • Name: displays the internal name of the target object. The internal name is assigned when an object is created and remains fixed throughout the existence of the object.
  • Label: displays the label of the target object. The label of an object can be changed by the user.
  • Position: displays the coordinates of the base point of the target object or of the target vertex.
  • Length: displays the length of the target object or subelement.
  • Area: displays the area of the target object or subelement.
  • Volume: displays the volume of the target object.
  • Tag: displays the Tag attribute of the target object. Objects created with the Arch Workbench can have this attribute.
  • Material: displays the label of the material of the target object.
  • Label + Position
  • Label + Length
  • Label + Area
  • Label + Volume
  • Label + Material

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.

Properties

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

  • DatosCustom Text (StringList): specifies the contents of the text if DatosLabel Type is Custom. Each item in the list represents a new text line.
  • DatosLabel Type (Enumeration): specifies the type of information displayed by the label. See Label types.
  • DatosPlacement (Placement): specifies the position of the text in the 3D view and, unless DatosStraight Direction is Custom, also of the first leader segment, which is the segment where the text is attached. See Placement.
  • DatosText (StringList): (read-only) specifies the contents of the text that is actually displayed. Each item in the list represents a new text line.

Leader

  • DatosPoints (VectorList): specifies the points of the leader.
  • DatosStraight Direction (Enumeration): specifies the direction of the first leader segment: Custom, Horizontal or Vertical.
  • DatosStraight Distance (Distance): specifies the length of the first leader segment. Only used if DatosStraight 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

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

View

Annotation

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

Display Options

  • VistaDisplay Mode (Enumeration): specifies how the text is displayed. If it is World the text will be displayed on a plane defined by the DatosPlacement 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

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

Text

  • VistaFont 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
  • VistaFont 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
  • VistaJustification (Enumeration): specifies the horizontal alignment of the text: Left, Center or Right. Only used if DatosStraight Direction is Custom. Otherwise the horizontal alignment is based on the sign (positive or negative) of DatosStraight Distance.
  • VistaLine Spacing (Float): specifies the factor applied to the default line height of the text.
  • VistaMax Chars (Integer): specifies the maximum number of characters on each line of the text.
  • VistaText Alignment (Enumeration): specifies the vertical alignment of the text: Top, Middle or Bottom.
  • VistaText Color (Color): specifies the color of the text.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

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)

Ejemplo:

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()