Draft Label: Difference between revisions
(Updated Options) |
(correction replace "TextSize" by "FontSize") |
||
(37 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Page_in_progress}} |
|||
<languages/> |
<languages/> |
||
<translate> |
<translate> |
||
Line 7: | Line 6: | ||
|[[Draft_Dimension|Dimension]] |
|[[Draft_Dimension|Dimension]] |
||
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]] |
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]] |
||
|[[ |
|[[Draft_Workbench|Draft]] |
||
|IconL=Draft_Dimension.svg |
|IconL=Draft_Dimension.svg |
||
|IconR=Draft_AnnotationStyleEditor.svg |
|IconR=Draft_AnnotationStyleEditor.svg |
||
Line 17: | Line 16: | ||
|Name=Draft Label |
|Name=Draft Label |
||
|MenuLocation=Annotation → Label |
|MenuLocation=Annotation → Label |
||
|Workbenches=[[ |
|Workbenches=[[Draft_Workbench|Draft]], [[Arch_Workbench|Arch]] |
||
|Shortcut={{KEY|D}} {{KEY|L}} |
|Shortcut={{KEY|D}} {{KEY|L}} |
||
|Version=0.17 |
|Version=0.17 |
||
Line 26: | Line 25: | ||
<!--T:15--> |
<!--T:15--> |
||
The [[Image:Draft_Label.svg|24px]] |
The [[Image:Draft_Label.svg|24px]] '''Draft Label''' command creates a multi-line text with a 2-segment leader line and an arrow. |
||
⚫ | |||
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. |
|||
<!--T:16--> |
<!--T:16--> |
||
Line 35: | Line 37: | ||
<translate> |
<translate> |
||
<!--T:3--> |
<!--T:3--> |
||
{{Caption|Various labels with different orientations, |
{{Caption|Various labels with different orientations, arrows and information}} |
||
==Usage== <!--T:4--> |
==Usage== <!--T:4--> |
||
<!--T:28--> |
|||
See also: [[Draft_Tray|Draft Tray]], [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]]. |
See also: [[Draft_Tray|Draft Tray]], [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]]. |
||
<!--T:5--> |
<!--T:5--> |
||
# Optionally select an object or a sub-element (vertex, edge or face) |
# Optionally select an object or a sub-element (vertex, edge or face) that you want to display attributes of. |
||
# There are several ways to invoke the command: |
# There are several ways to invoke the command: |
||
#* Press the {{Button|[[Image:Draft_Label.svg|16px]] [[Draft_Label| |
#* Press the {{Button|[[Image:Draft_Label.svg|16px]] [[Draft_Label|Label]]}} button. |
||
#* Select the {{MenuCommand|Annotation → [[Image:Draft_Label.svg|16px]] Label}} option from the menu. |
#* Select the {{MenuCommand|Annotation → [[Image:Draft_Label.svg|16px]] Label}} option from the menu. |
||
#* Use the keyboard shortcut: {{KEY|D}} then {{KEY|L}}. |
#* Use the keyboard shortcut: {{KEY|D}} then {{KEY|L}}. |
||
# The {{MenuCommand|Label}} task panel opens. See [[#Options|Options]] for more information. |
# The {{MenuCommand|Label}} task panel opens. See [[#Options|Options]] for more information. |
||
# If you have selected an element: select |
# 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 |
# 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 |
# 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 |
# 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== <!--T:6--> |
==Options== <!--T:6--> |
||
<!--T:29--> |
|||
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. |
|||
<!--T:7--> |
<!--T:7--> |
||
* To enter coordinates |
* 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. |
||
* 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. |
|||
* Hold {{KEY|Ctrl}} while placing the label to force [[Draft_Snap|snapping]] your point to the nearest snap location, independently of the distance. |
|||
* 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. |
|||
⚫ | |||
== Label types == <!--T:10--> |
|||
<!--T:48--> |
|||
The following label types are available: |
|||
<!--T:11--> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
==Notes== |
==Notes== <!--T:30--> |
||
<!--T:17--> |
<!--T:17--> |
||
* The direction of the |
* 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. |
|||
* By pre-selecting an object, or a sub-element (vertex, edge or face), before pressing the command 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. |
|||
==Properties== <!--T:8--> |
==Properties== <!--T:8--> |
||
<!--T:31--> |
|||
See also: [[ |
See also: [[Property_editor|Property editor]]. |
||
<!--T:32--> |
|||
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: |
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 === |
=== Data === <!--T:33--> |
||
<!--T:34--> |
|||
{{TitleProperty|Label}} |
{{TitleProperty|Label}} |
||
Line 82: | Line 114: | ||
* {{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. |
* {{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. |
||
<!--T:35--> |
|||
{{TitleProperty|Leader}} |
{{TitleProperty|Leader}} |
||
<!--T:36--> |
|||
* {{PropertyData|Points|VectorList}}: specifies the points of the 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 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. |
* {{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. |
||
<!--T:37--> |
|||
{{TitleProperty|Target}} |
{{TitleProperty|Target}} |
||
<!--T:38--> |
|||
* {{PropertyData|Target|LinkSub}}: specifies the object and optional subelement the label is linked to. |
* {{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. |
* {{PropertyData|Target Point|Vector}}: specifies the position of the tip of the leader, which is where the arrow is attached. |
||
=== View === <!--T:39--> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=== View === |
|||
<!--T:40--> |
|||
{{TitleProperty|Annotation}} |
{{TitleProperty|Annotation}} |
||
<!--T:41--> |
|||
* {{PropertyView|Annotation Style|Enumeration}}: specifies the annotation style applied to the label. See [[Draft_AnnotationStyleEditor|Draft AnnotationStyleEditor]]. |
* {{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. |
* {{PropertyView|Scale Multiplier|Float}}: specifies the general scaling factor applied to the label. |
||
<!--T:42--> |
|||
{{TitleProperty|Display Options}} |
{{TitleProperty|Display Options}} |
||
<!--T:43--> |
|||
* {{PropertyView|Display Mode|Enumeration}}: specifies how the text is displayed. If it is {{value| |
* {{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}}). |
||
<!--T:44--> |
|||
{{TitleProperty|Graphics}} |
{{TitleProperty|Graphics}} |
||
Line 129: | Line 152: | ||
* {{PropertyView|Frame|Enumeration}}: specifies what type of frame is drawn around the text. The current options are {{Value|None}} or {{Value|Rectangle}}. |
* {{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|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. |
* {{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. |
* {{PropertyView|Line Width|Float}}: specifies the width of the leader. This is also used for the frame ({{Version|0.20}}). |
||
<!--T:45--> |
|||
{{TitleProperty|Text}} |
{{TitleProperty|Text}} |
||
<!--T:46--> |
|||
⚫ | * {{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|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|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|Line Spacing|Float}}: specifies the factor applied to the default line height of the text. |
||
Line 139: | Line 166: | ||
* {{PropertyView|Text Alignment|Enumeration}}: specifies the vertical alignment of the text: {{value|Top}}, {{value|Middle}} or {{value|Bottom}}. |
* {{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. |
* {{PropertyView|Text Color|Color}}: specifies the color of the text. |
||
⚫ | * {{PropertyView| |
||
⚫ | |||
==Scripting== |
==Scripting== <!--T:47--> |
||
<!--T:12--> |
<!--T:12--> |
||
See also: [https:// |
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]]. |
||
<!--T:20--> |
<!--T:20--> |
||
Line 168: | Line 193: | ||
import FreeCAD as App |
import FreeCAD as App |
||
import Draft |
import Draft |
||
doc = App.newDocument() |
|||
rectangle = Draft.make_rectangle(4000, 1000) |
rectangle = Draft.make_rectangle(4000, 1000) |
||
doc.recompute() |
|||
p1 = App.Vector(-200, 1000, 0) |
p1 = App.Vector(-200, 1000, 0) |
||
Line 176: | Line 203: | ||
label1 = Draft.make_label(p1, place1, target_object=rectangle, distance=500, label_type="Label") |
label1 = Draft.make_label(p1, place1, target_object=rectangle, distance=500, label_type="Label") |
||
label1.ViewObject. |
label1.ViewObject.FontSize= 200 |
||
p2 = App.Vector(-200, 0, 0) |
p2 = App.Vector(-200, 0, 0) |
||
Line 183: | Line 210: | ||
label2 = Draft.make_label(p2, place2, target_object=rectangle, distance=500, label_type="Custom", |
label2 = Draft.make_label(p2, place2, target_object=rectangle, distance=500, label_type="Custom", |
||
custom_text="Beware of the sharp edges") |
custom_text="Beware of the sharp edges") |
||
label2.ViewObject. |
label2.ViewObject.FontSize= 200 |
||
p3 = App.Vector(1000, 1200, 0) |
p3 = App.Vector(1000, 1200, 0) |
||
Line 189: | Line 216: | ||
label3 = Draft.make_label(p3, place3, target_object=rectangle, distance=-500, label_type="Area") |
label3 = Draft.make_label(p3, place3, target_object=rectangle, distance=-500, label_type="Area") |
||
label3.ViewObject. |
label3.ViewObject.FontSize= 200 |
||
doc.recompute() |
|||
}} |
}} |
||
<translate> |
<translate> |
||
Line 200: | Line 227: | ||
|[[Draft_Dimension|Dimension]] |
|[[Draft_Dimension|Dimension]] |
||
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]] |
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]] |
||
|[[ |
|[[Draft_Workbench|Draft]] |
||
|IconL=Draft_Dimension.svg |
|IconL=Draft_Dimension.svg |
||
|IconR=Draft_AnnotationStyleEditor.svg |
|IconR=Draft_AnnotationStyleEditor.svg |
Latest revision as of 17:14, 7 April 2024
Draft Label |
Menu location |
---|
Annotation → Label |
Workbenches |
Draft, Arch |
Default shortcut |
D L |
Introduced in version |
0.17 |
See also |
Draft Text, Draft ShapeString |
Description
The Draft Label command creates a multi-line text with a 2-segment leader line and an arrow.
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.
Various labels with different orientations, arrows and information
Usage
See also: Draft Tray, Draft Snap and Draft Constrain.
- Optionally select an object or a sub-element (vertex, edge or face) that you want to display attributes of.
- 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.
- The Label task panel opens. See Options for more information.
- If you have selected an element: select an option from the Label type dropdown list. See Label types below.
- 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.
- 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.
- 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 DataCustom 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 theTag
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
- DataCustom Text (
StringList
): specifies the contents of the text if DataLabel Type isCustom
. Each item in the list represents a new text line. - DataLabel Type (
Enumeration
): specifies the type of information displayed by the label. See Label types. - DataPlacement (
Placement
): specifies the position of the text in the 3D view and, unless DataStraight Direction isCustom
, also of the first leader segment, which is the segment where the text is attached. See Placement. - DataText (
StringList
): (read-only) specifies the contents of the text that is actually displayed. Each item in the list represents a new text line.
Leader
- DataPoints (
VectorList
): specifies the points of the leader. - DataStraight Direction (
Enumeration
): specifies the direction of the first leader segment:Custom
,Horizontal
orVertical
. - DataStraight Distance (
Distance
): specifies the length of the first leader segment. Only used if DataStraight Direction isHorizontal
orVertical
. 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
- DataTarget (
LinkSub
): specifies the object and optional subelement the label is linked to. - DataTarget Point (
Vector
): specifies the position of the tip of the leader, which is where the arrow is attached.
View
Annotation
- ViewAnnotation Style (
Enumeration
): specifies the annotation style applied to the label. See Draft AnnotationStyleEditor. - ViewScale Multiplier (
Float
): specifies the general scaling factor applied to the label.
Display Options
- ViewDisplay Mode (
Enumeration
): specifies how the text is displayed. If it isWorld
the text will be displayed on a plane defined by the DataPlacement of the label. If it isScreen
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
- ViewArrow Size (
Length
): specifies the size of the symbol displayed at the tip of the leader. - ViewArrow Type (
Enumeration
): specifies the type of symbol displayed at the tip of the leader, which can beDot
,Circle
,Arrow
,Tick
orTick-2
. - ViewFrame (
Enumeration
): specifies what type of frame is drawn around the text. The current options areNone
orRectangle
. - ViewLine (
Bool
): specifies whether to display the leader line. If it isfalse
only the arrow and the text are displayed. - ViewLine Color (
Color
): specifies the color of the leader and the arrow. This is also used for the frame (introduced in version 0.20). - ViewLine Width (
Float
): specifies the width of the leader. This is also used for the frame (introduced in version 0.20).
Text
- ViewFont Name (
Font
): specifies the font used to draw the text. It can be a font name, such asArial
, a default style such assans
,serif
ormono
, a family such asArial,Helvetica,sans
, or a name with a style such asArial:Bold
. If the given font is not found on the system, a default font is used instead. introduced in version 0.21 - ViewFont 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 - ViewJustification (
Enumeration
): specifies the horizontal alignment of the text:Left
,Center
orRight
. Only used if DataStraight Direction isCustom
. Otherwise the horizontal alignment is based on the sign (positive or negative) of DataStraight Distance. - ViewLine Spacing (
Float
): specifies the factor applied to the default line height of the text. - ViewMax Chars (
Integer
): specifies the maximum number of characters on each line of the text. - ViewText Alignment (
Enumeration
): specifies the vertical alignment of the text:Top
,Middle
orBottom
. - ViewText 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)
Example:
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()
- Drafting: Line, Polyline, Fillet, Arc, Arc by 3 points, Circle, Ellipse, Rectangle, Polygon, B-spline, Cubic Bézier curve, Bézier curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation styles, Annotation scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar array, Circular array, Path array, Path link array, Point array, Point link array, Edit, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select plane, Set style, Toggle construction mode, AutoGroup
- Snapping: Snap lock, Snap endpoint, Snap midpoint, Snap center, Snap angle, Snap intersection, Snap perpendicular, Snap extension, Snap parallel, Snap special, Snap near, Snap ortho, Snap grid, Snap working plane, Snap dimensions, Toggle grid
- Miscellaneous: Apply current style, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Text: Open hyperlinks
- Wire: Flatten
- Working plane proxy: Write camera position, Write objects state
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub