Why can't I create a line from two points?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
crobar
Posts: 160
Joined: Fri Aug 29, 2014 1:26 pm

Why can't I create a line from two points?

Post by crobar »

Could someone tell me what exactly I am doing wrong here to generate the error?

Code: Select all

>>> Part.Line (Part.Point (Vector (-0.500000, -0.500000, -0.500000)), Part.Point (Vector (-0.500000, -0.500000, -0.0)))
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: Line constructor accepts:
-- empty parameter list
-- Line
-- Point, Point
Help for Line states:

Code: Select all

Help on class GeomLineSegment in module Part:

class GeomLineSegment(GeomCurve)
 |  Describes an infinite line
 |  To create a line there are several ways:
 |  Part.Line()
 |      Creates a default line
 |  
 |  Part.Line(Line)
 |      Creates a copy of the given line
 |  
 |  Part.Line(Point1,Point2)
 |      Creates a line that goes through two given points
 |  
Thanks
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Why can't I create a line from two points?

Post by ickby »

Hello,

it seems the documentation is missleading, the Point should be given as Vector and not as Part.Point, something like this:

Code: Select all

Part.Line (App.Vector (-0.500000, -0.500000, -0.500000), App.(Vector (-0.500000, -0.500000, -0.0))
I think the documentation should be changed in any case and IMHO we should also allow the line creation from two Part.Point . Please add a mantis ticket for this.
crobar
Posts: 160
Joined: Fri Aug 29, 2014 1:26 pm

Re: Why can't I create a line from two points?

Post by crobar »

ickby wrote:Hello,

it seems the documentation is missleading, the Point should be given as Vector and not as Part.Point, something like this:

Code: Select all

Part.Line (App.Vector (-0.500000, -0.500000, -0.500000), App.(Vector (-0.500000, -0.500000, -0.0))
I think the documentation should be changed in any case and IMHO we should also allow the line creation from two Part.Point . Please add a mantis ticket for this.
Ahh, ok, thanks.
Post Reply