Draft Line

From FreeCAD Documentation
Revision as of 00:10, 7 November 2018 by Vocx (talk | contribs) (Better explanation of subdivisions)

Draft Line

Menu location
Draft → Line
Workbenches
Draft, Arch
Default shortcut
L I
Introduced in version
-
See also
Draft Wire

Description

The Line tool creates a straight line defined by two points. It uses the Draft Linestyle set on the Draft Tray. The Line tool behaves exactly like the Draft Wire tool, except that it stops after two points.

How to use

  1. Press the Draft Line button, or press L then I keys
  2. Click a first point on the 3D view, or type a coordinate
  3. Click a second point on the 3D view, or type a coordinate

Options

  • Press X, Y or Z after the first point to constrain the second point on the given axis.
  • To enter coordinates manually, simply enter the numbers, then press Enter between each X, Y and Z component.
  • Press R or click the checkbox to toggle relative mode. If relative mode is on, the coordinates of the second point are relative to the first one; if not, they are absolute, taken from the origin (0,0,0).
  • Press T or click the checkbox to toggle continue mode. If continue mode is on, the Line tool will restart after you give the second point, allowing you to draw another line segment without pressing the tool button again.
  • Press Ctrl while drawing to force snapping your point to the nearest snap location, independently of the distance.
  • Press Shift while drawing to constrain your second point horizontally or vertically in relation to the first one.
  • Press Ctrl+Z or press the Undo button to undo the last point.
  • Press Esc or the Cancel button to abort the current command.
  • If several connected Draft Lines are selected they can be transformed into a wire by pressing the Draft Upgrade tool. However, these wires aren't editable. To create an editable wire, use Draft Wire.

Properties

A Line object shares all properties from a Draft Wire, however, only some of these properties are applicable to the Line.

Data

  • DataStart: specifies the start point
  • DataEnd: specifies the end point
  • DataSubdivisions: specifies the number of interior nodes in the line introduced in version 0.16
  • DataLength: (read-only) specifies the length of the segment

View

  • ViewArrow Size: specifies the size of the symbol displayed at the end of the wire.
  • ViewArrow Type: specifies the type of symbol displayed at the end of the wire, which can be dot, circle, arrow, or tick.
  • ViewEnd Arrow: specifies whether to show a symbol at the last point of the wire, so it can be used as an annotation line.

Scripting

See also: FreeCAD Scripting Basics, Draft API, and the autogenerated API documentation.

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

Line = makeLine(p1, p2)
Line = makeLine(LineSegment)
Line = makeLine(Shape)
  • Creates a Line object between points p1 and p2, each defined as a FreeCAD.Vector, with units in millimeters
  • Creates a Line object from a Part.LineSegment
  • Creates a Line object from the first vertex to the last vertex of the given Shape

Example:

import FreeCAD, Draft

p1 = FreeCAD.Vector(0, 0, 0)
p2 = FreeCAD.Vector(1000, 500, 0)
p3 = FreeCAD.Vector(-250, -500, 0)
p4 = FreeCAD.Vector(500, 1000, 0)

Line1 = Draft.makeLine(p1, p2)
Line2 = Draft.makeLine(p3, p4)