|
Menu location |
---|
Drafting → Line 2D Drafting → Line |
Workbenches |
Draft, BIM |
Default shortcut |
L I |
Introduced in version |
0.7 |
See also |
Draft Wire |
The Draft Line command creates a straight line.
A Draft Line is in fact a Draft Wire with only two points.
Line defined by two points
See also: Draft Tray, Draft Snap and Draft Constrain.
The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts (for version 1.0).
See also: Preferences Editor and Draft Preferences.
See Draft Wire.
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
To create a Draft Line use the make_line
method (introduced in version 0.19) of the Draft module. This method replaces the deprecated makeLine
method.
line = make_line(p1, p2)
line = make_line(LineSegment)
line = make_line(Shape)
Line
object between points p1
and p2
, each defined by its FreeCAD.Vector
, with units in millimeters.Line
object from a Part.LineSegment
.Line
object from the first vertex to the last vertex of the given Shape
.Example:
import FreeCAD as App
import Draft
doc = App.newDocument()
p1 = App.Vector(0, 0, 0)
p2 = App.Vector(1000, 500, 0)
p3 = App.Vector(-250, -500, 0)
p4 = App.Vector(500, 1000, 0)
line1 = Draft.make_line(p1, p2)
line2 = Draft.make_line(p3, p4)
doc.recompute()