TechDraw LeaderLine: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
 
(65 intermediate revisions by 12 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:16-->
<!--T:16-->
{{Docnav
{{Docnav|[[TechDraw_Redraw|Redraw]]|[[TechDraw_RichTextBlock|RichTextBlock]]|[[TechDraw_Module|TechDraw]]|IconL=TechDraw_Tree_Page_Sync.png|IconC=Workbench_TechDraw.svg|IconR=Techdraw-textleader.svg}}
|[[TechDraw_Annotation|Annotation]]
|[[TechDraw_RichTextAnnotation|RichTextAnnotation]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw_Annotation.svg
|IconR=TechDraw_RichTextAnnotation.svg
|IconC=Workbench_TechDraw.svg
}}


<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand
|Name=TechDraw LeaderLine
|Name=TechDraw LeaderLine
|MenuLocation=TechDraw → Add Lines → Add Leaderline to View
|Icon=techdraw-mline.svg
|Workbenches=[[TechDraw_Workbench|TechDraw]]
|MenuLocation=TechDraw → LeaderLine
|Version=0.19
|Workbenches=[[TechDraw Module|TechDraw]]
|SeeAlso=[[TechDraw_RichTextAnnotation|TechDraw RichTextAnnotation]], [[TechDraw_WeldSymbol|TechDraw WeldSymbol]]
|SeeAlso=[[TechDraw Templates]], [[Draft SVG]], [[TechDraw_RichTextBlock|RichTextBlock]]
}}
}}


Line 16: Line 24:


<!--T:8-->
<!--T:8-->
The LeaderLine tool adds a line to a View. Other annotation objects (such as [[TechDraw_RichTextBlock|RichTextBlock]]) can be connected to the LeaderLine to form complex annotations.
The '''TechDraw LeaderLine''' tool adds a line to a View. Other annotation objects (such as [[TechDraw_RichTextAnnotation|Rich Text Annotations]]) can be connected to the leaderline to form complex annotations.


</translate>
</translate>
Line 22: Line 30:
<translate>
<translate>
<!--T:9-->
<!--T:9-->
{{Caption|Leader line added to View001}}
{{Caption|Leaderline added to a View}}


==How to use== <!--T:3-->
==Usage create== <!--T:3-->


<!--T:10-->
<!--T:10-->
# Select a View.
# Press the {{Button|[[Image:techdraw-mline.svg|16px]] [[TechDraw LeaderLine|LeaderLine]]}} button
# There are several ways to invoke the tool:
# A Task dialog will open. The dialog allows drawing of the leader line and assigning end symbols to the line.
#* Press the {{Button|[[Image:TechDraw_LeaderLine.svg|16px]] [[TechDraw_LeaderLine|Add Leaderline to View]]}} button.
# The Pick points button starts a line drawing function. Line drawing always starts at the point the line is to be attached to the View.
#* Select the {{MenuCommand|TechDraw → Add Lines → [[Image:TechDraw_LeaderLine.svg|16px]] Add Leaderline to View}} option from the menu.
# Click to add a point, move the mouse to draw a line segment.
# A task panel opens.
# To exit the line editor, press the Save changes button.
# Press the {{Button|Pick points}} button.
# To exit the line editor without saving, press the Discard changes button.
# After the line is created, it can be edited by double clicking the LeaderLine in the Tree.
# Pick the first point on the page to define the start point of the line.
# Pick the next point on the page. Hold down {{KEY|Ctrl}} to snap to multiples of 22.5° angles. Optionally use a double-click instead of a single-click to finish entering points.
# Optionally add more points.
# If you have not double-clicked a point: press the {{Button|Save Points}} button.
# Optionally change the '''Start Symbol''', '''End Symbol''', '''Color''', '''Width''' and '''Style''' of the leader. See [[#Properties|Properties]] for more information.
# Press the {{Button|OK}} button.

==Usage edit== <!--T:27-->

<!--T:25-->
# Double-click a Leaderline in the [[Tree_view|Tree view]].
# A task panel opens.
# To edit the points:
## Press the {{Button|Edit points}} button.
## The Leaderline is marked with temporary nodes.
## Drag one or more of the nodes to a new position.
## Press the {{Button|Save changes}} button.
# Optionally change the '''Start Symbol''', '''End Symbol''', '''Color''', '''Width''' and '''Style''' of the leader. See [[#Properties|Properties]] for more information.
# Press the {{Button|OK}} button.

==Notes== <!--T:26-->

<!--T:18-->
* You cannot add or remove points from an existing Leaderline.
* If no points were specified at creation time a short line is placed at the center of the View. There is no way to fix such a line, it should be deleted.
* By default the '''Leader Line Auto Horizontal''' [[TechDraw_Preferences#Annotation|preference]] is checked. This means that the last line segment of new Leaderlines is drawn horizontally. If there is only one segment the result is then a single horizontal line.
* You can turn off this auto horizontal feature for existing Leaderlines by changing their {{PropertyData|Auto Horizontal}} property.


==Properties== <!--T:19-->
==Properties== <!--T:19-->


<!--T:20-->
===Data=== <!--T:28-->

* {{PropertyData|X,Y}}: The point at which the leader line is connected to the View.
<!--T:29-->
* {{PropertyData|Leader Parent}}: The View to which the leader is attached.
{{Properties_Title|Base}}
* {{PropertyData|Start Symbol}}: The line end symbol (arrowhead) at the View end.

* {{PropertyData|End Symbol}}: The line end symbol at the other end.
<!--T:30-->
* {{PropertyData|WayPoints}}: Nodes on the leader line.
* {{PropertyData|Start Symbol|Enumeration}}: The symbol at the start of the leaderline. Options: [[Image:Arrowfilled.svg|20px]] Filled Arrow, [[Image:Arrowopen.svg|20px]] Open Arrow, [[Image:Arrowtick.svg|20px]] Tick, [[Image:Arrowdot.svg|20px]] Dot, [[Image:arrowopendot.svg|20px]] Open Circle, [[Image:arrowfork.svg|20px]] Fork, [[Image:arrowpyramid.svg|20px]] Filled Triangle, None.
* {{PropertyData|Scalable}}: Leader scales with Leader Parent.
* {{PropertyData|End Symbol|Enumeration}}: The symbol at the end of the leaderline. Idem.
* {{PropertyView|Color}}: Pen colour for the leader line.
* {{PropertyData|X|Distance}}: The X coordinate of the leaderline relative to the View.
* {{PropertyView|Line Style}}: 0 - No Line, 1 - Solid Line, ...
* {{PropertyData|Y|Distance}}: The Y coordinate of the leaderline relative to the View.
* {{PropertyView|Line Width}}: Weight of leader line.

<!--T:31-->
{{Properties_Title|Leader}}

<!--T:32-->
* {{PropertyData|Leader Parent|Link}}: The View the leaderline is attached to.
* {{PropertyData|Way Points|VectorList}}: The points of the leaderline.
* {{PropertyData|Scalable|Bool}}: Specifies if the leaderline scales with {{PropertyData|Leader Parent}}.
* {{PropertyData|Auto Horizontal|Bool}}: Specifies if the last leaderline segment is forced to be horizontal.

===View=== <!--T:33-->

<!--T:34-->
{{TitleProperty|Base}}

<!--T:35-->
* {{PropertyView|Keep Label|Bool}}: Not used.
* {{PropertyView|Stack Order|Integer}}: Over or underlap relative to other drawing objects. {{Version|0.21}}

<!--T:36-->
{{TitleProperty|Line Format}}

<!--T:37-->
* {{PropertyView|Color|Color}}: The color of the leaderline.
* {{PropertyView|Line Style|Enumeration}}: The style of the leaderline. Options: NoLine, [[Image:Continuous-line.svg|20px]] Continuous, [[Image:Dash-line.svg|20px]] Dash, [[Image:Dot-line.svg|20px]] Dot, [[Image:DashDot-line.svg|20px]] DashDot, [[Image:DashDotDot-line.svg|20px|Length]] DashDotDot.
* {{PropertyView|Line Width|Length}}: The width of the leaderline.


==Scripting== <!--T:6-->
==Scripting== <!--T:6-->


<!--T:12-->
<!--T:12-->
{{Emphasis|See also:}} [[TechDraw API]] and [[FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:13-->
<!--T:13-->
The LeaderLine tool can be used in [[macros]] and from the [[Python]] console by using the following functions:
The LeaderLine tool can be used in [[Macros|macros]] and from the [[Python|Python]] console by using the following functions:


</translate>
</translate>
Line 69: Line 129:
leaderObj.Y = 5
leaderObj.Y = 5
}}
}}

<translate>
<translate>


==Notes== <!--T:18-->
* This feature was added in v0.19
* You can edit your LeaderLine by double clicking on it in the tree view. Double clicking in the graphics area is not yet supported.
* The leader line can be edited by pressing "Edit points" while in edit mode. To exit point editing: press "Save changes" or "Discard changes".


<!--T:17-->
<!--T:17-->
{{Docnav
{{Docnav|[[TechDraw_Redraw|Redraw]]|[[TechDraw_RichTextBlock|RichTextBlock]]|[[TechDraw_Module|TechDraw]]|IconL=TechDraw_Tree_Page_Sync.png|IconC=Workbench_TechDraw.svg|IconR=Techdraw-textleader.svg}}
|[[TechDraw_Annotation|Annotation]]

|[[TechDraw_RichTextAnnotation|RichTextAnnotation]]
<!--T:14-->
|[[TechDraw_Workbench|TechDraw]]
{{TechDraw Tools navi}}
|IconL=TechDraw_Annotation.svg
|IconR=TechDraw_RichTextAnnotation.svg
|IconC=Workbench_TechDraw.svg
}}


<!--T:15-->
{{Userdocnavi}}
</translate>
</translate>
{{TechDraw Tools navi{{#translation:}}}}
{{clear}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 10:03, 27 July 2023

TechDraw LeaderLine

Menu location
TechDraw → Add Lines → Add Leaderline to View
Workbenches
TechDraw
Default shortcut
None
Introduced in version
0.19
See also
TechDraw RichTextAnnotation, TechDraw WeldSymbol

Description

The TechDraw LeaderLine tool adds a line to a View. Other annotation objects (such as Rich Text Annotations) can be connected to the leaderline to form complex annotations.

Leaderline added to a View

Usage create

  1. Select a View.
  2. There are several ways to invoke the tool:
    • Press the Add Leaderline to View button.
    • Select the TechDraw → Add Lines → Add Leaderline to View option from the menu.
  3. A task panel opens.
  4. Press the Pick points button.
  5. Pick the first point on the page to define the start point of the line.
  6. Pick the next point on the page. Hold down Ctrl to snap to multiples of 22.5° angles. Optionally use a double-click instead of a single-click to finish entering points.
  7. Optionally add more points.
  8. If you have not double-clicked a point: press the Save Points button.
  9. Optionally change the Start Symbol, End Symbol, Color, Width and Style of the leader. See Properties for more information.
  10. Press the OK button.

Usage edit

  1. Double-click a Leaderline in the Tree view.
  2. A task panel opens.
  3. To edit the points:
    1. Press the Edit points button.
    2. The Leaderline is marked with temporary nodes.
    3. Drag one or more of the nodes to a new position.
    4. Press the Save changes button.
  4. Optionally change the Start Symbol, End Symbol, Color, Width and Style of the leader. See Properties for more information.
  5. Press the OK button.

Notes

  • You cannot add or remove points from an existing Leaderline.
  • If no points were specified at creation time a short line is placed at the center of the View. There is no way to fix such a line, it should be deleted.
  • By default the Leader Line Auto Horizontal preference is checked. This means that the last line segment of new Leaderlines is drawn horizontally. If there is only one segment the result is then a single horizontal line.
  • You can turn off this auto horizontal feature for existing Leaderlines by changing their DataAuto Horizontal property.

Properties

Data

Base

  • DataStart Symbol (Enumeration): The symbol at the start of the leaderline. Options: Filled Arrow, Open Arrow, Tick, Dot, Open Circle, Fork, Filled Triangle, None.
  • DataEnd Symbol (Enumeration): The symbol at the end of the leaderline. Idem.
  • DataX (Distance): The X coordinate of the leaderline relative to the View.
  • DataY (Distance): The Y coordinate of the leaderline relative to the View.

Leader

  • DataLeader Parent (Link): The View the leaderline is attached to.
  • DataWay Points (VectorList): The points of the leaderline.
  • DataScalable (Bool): Specifies if the leaderline scales with DataLeader Parent.
  • DataAuto Horizontal (Bool): Specifies if the last leaderline segment is forced to be horizontal.

View

Base

  • ViewKeep Label (Bool): Not used.
  • ViewStack Order (Integer): Over or underlap relative to other drawing objects. introduced in version 0.21

Line Format

  • ViewColor (Color): The color of the leaderline.
  • ViewLine Style (Enumeration): The style of the leaderline. Options: NoLine, Continuous, Dash, Dot, DashDot, Length DashDotDot.
  • ViewLine Width (Length): The width of the leaderline.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

The LeaderLine tool can be used in macros and from the Python console by using the following functions:

myPage = FreeCAD.ActiveDocument().Page
myBase = FreeCAD.ActiveDocument().View
leaderObj = FreeCAD.ActiveDocument.addObject('TechDraw::DrawLeaderLine','DrawLeaderLine')
FreeCAD.activeDocument().myPage.addView(leaderObj)
FreeCAD.activeDocument().leaderObj.LeaderParent = myBase
#first waypoint is always (0,0,0)  
#rest of waypoints are positions relative to (0,0,0)
leaderObj.WayPoints = [p0,p1,p2]
leaderObj.X = 5
leaderObj.Y = 5