Given Methods for Polylines and Points

Given Methods for Polylines and Points

glandorf
Explorer Explorer
370 Views
3 Replies
Message 1 of 4

Given Methods for Polylines and Points

glandorf
Explorer
Explorer

Hi,

 

It's been a few years since I've worked intensively with .net and Autocad. However, I have now been asked to programme a new function and need some help with the available methods.

 

The function should query two points on a 3Dpolyline or normal polyline and construct a point in between depending on a distance from the first point.

 

Are there functions that I can use here, e.g. to determine the polyline under the first point, to check whether the second point lies on the identical polyline and to determine the coordinates of the new point?

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

_gile
Consultant
Consultant
Accepted solution

Hi,

 


@glandorf wrote:

The function should query two points on a 3Dpolyline or normal polyline and construct a point in between depending on a distance from the first point.


Have a look at Curve.GetDistAtPoint and Curve.GetPointAtDist methods.

 


@glandorf wrote:

Are there functions that I can use here, e.g. to determine the polyline under the first point, to check whether the second point lies on the identical polyline and to determine the coordinates of the new point?


You can check if the supplied point IsEqualTo  the  one returned by Curve.GetClosestPointTo.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 4

glandorf
Explorer
Explorer

Thank you very much. It worked.

I knew there were some functions like that, but had no idea that I could handle all polyline types with the Curve class.

0 Likes
Message 4 of 4

_gile
Consultant
Consultant

@glandorf wrote:

I had no idea that I could handle all polyline types with the Curve class.


You have to understand inheritance. All Polyline types but also Lin, Arc, Circle Ellipse, Spline, ... derive from the Curve class.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes