TechDraw LeaderLine

From FreeCAD Documentation
Revision as of 09:01, 27 July 2023 by Roy 043 (talk | contribs)

TechDraw LeaderLine

Menu location
TechDraw → Add Lines → Add Leaderline to View
Workbenches
TechDraw
Default shortcut
None
Introduced in version
0.19
See also
TechDraw Rich Text Annotation, TechDraw Welding Symbol, TechDraw Line Group

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 View001

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. See Usage edit for more information.
  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. Press the OK button.

Notes

  • If you did not define any points when creating the leaderline, a short line will be placed at the center of the view. You can later not add further points.
  • By default the preferences option Leader Line Auto Horizontal is activated. Therefore the last line segment will be horizontal. So if you only have one segment, you get a horizontal line, no matter where you picked the second point.
  • You can turn off the auto horizontal feature for existing Leaderlines changing the DataAuto Horizontal property.

Properties

  • DataX,Y: The point at which the leaderline is connected to the View.
  • DataLeader Parent: The View to which the leader is attached.
  • DataStart Symbol: The symbol at the start: None, Filled Arrow, Open Arrow, Tick, Dot, Open Circle, Fork, Filled Triangle
  • DataEnd Symbol: The symbol at the end.
  • DataWayPoints: Nodes on the leaderline.
  • DataScalable: Leader scales with Leader Parent.
  • DataAuto Horizontal: Forces last leaderline segment to be horizontal.
  • ViewColor: Pen colour for the leaderline.
  • ViewLine Style: 0 NoLine, 1 Continuous, 2 Dash, 3 Dot, 4 DashDot, 5 DashDotDot
  • ViewLine Width: Width of 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