Why is the coordinate of curve.origin and curve.getendpoint(0) different?What is their transformation relationship?

Why is the coordinate of curve.origin and curve.getendpoint(0) different?What is their transformation relationship?

lingchris
Explorer Explorer
373 Views
3 Replies
Message 1 of 4

Why is the coordinate of curve.origin and curve.getendpoint(0) different?What is their transformation relationship?

lingchris
Explorer
Explorer

lingchris_0-1657855044238.png

lingchris_1-1657855340274.png

 

 

0 Likes
Accepted solutions (1)
374 Views
3 Replies
Replies (3)
Message 2 of 4

lingchris
Explorer
Explorer

lingchris_0-1657870616832.png

lingchris_1-1657870654765.png

why are locationCurve.Curve different from geometryElement line?it makes me so confused.

Dim pt = locationCruve. Curve.Evaluate(0, False)

It is wrong for me to regard this pt as the world coordinate of the starting point of the line,It shouldn't be like this.

 

0 Likes
Message 3 of 4

RPTHOMAS108
Mentor
Mentor
Accepted solution

Origin and direction relate to the equation of the unbound line.

 

Therefore I believe that when you drag the ends of an existing bound line without changing it's direction then the end parameters change not the origin. It is still on the same alignment you just change how the bound extents were defined from the origin.

 

If you want to get the end points of the line then use GetEndPoint

Could also use Evaluate(0, True) & Evaluate(1, True) i.e. the normalised parameter for bound curve. If the curve is unbound then evaluating the normalised parameter (or using GetEndPoint) will throw an exception.

 

There is no advantage of using say:

Evaluate(0, True) instead of GetEndPoint(0)

 

Likewise you can get the raw parameters of the bound curve via Curve.GetEndParameter, again if the curve is unbound then evaluating this will throw an exception.

 

Also location line may not match a geometry line from the family because they were generated with different origin and parameters meaning they are two alternate representations of the same line. Best to check the end points as noted above. You can also compare via Curve.Intersect(Curve) review SetComparisonResult.

Message 4 of 4

lingchris
Explorer
Explorer
thank you for take the time to answer my questions.
I used to think that a world coordinate of bound curve pt = curve.Evaluate(distanceToOrigin,false) could instead of pt =curve.Origin + distanceToOrigin*curve.Direction.it seems incorrect in some cases.