.NET

Reply
Valued Contributor
bikelink
Posts: 54
Registered: ‎11-25-2001
Message 1 of 5 (429 Views)

spline to pline API ?

429 Views, 4 Replies
10-25-2010 03:04 AM

i'm looking for the api to convert a spline to pline (autocad 2010 can do it with convert)

I hope exists also an api that we call to make it..

any idea ?

thanks in advance!

Distinguished Contributor
SEANT61
Posts: 123
Registered: ‎09-23-2008
Message 2 of 5 (426 Views)

Re: spline to pline API ?

10-25-2010 03:14 AM in reply to: bikelink

There is the Spline.ToPolylineWithPrecision Method.

 

Valued Contributor
bikelink
Posts: 54
Registered: ‎11-25-2001
Message 3 of 5 (415 Views)

Re: spline to pline API ?

10-25-2010 05:05 AM in reply to: bikelink

ok, for previous version this is not available.. some work around to make it possible also with 2009 ?

Distinguished Contributor
SEANT61
Posts: 123
Registered: ‎09-23-2008
Message 4 of 5 (377 Views)

Re: spline to pline API ?

10-26-2010 01:53 AM in reply to: bikelink

How do you intend to recreate the path?  I suppose recreating the Spline’s path with arcs would be a bit difficult – short line segments, however, should be fairly easy.  If the spline’s total parameter (Interval)  were divide by the appropriate amount:

 

Double seg = (Spline.EndParam – Spline.StartParam) / 100;

 

For example, then a for loop could find successive position with Spline.GetPointAtParameter.  One characteristic of Splines is that the Interval naturally compresses at areas of high curvature so the chord height is kept to a minimal.

Valued Mentor
Jeffrey_H
Posts: 372
Registered: ‎01-20-2010
Message 5 of 5 (363 Views)

Re: spline to pline API ?

10-26-2010 04:58 AM in reply to: SEANT61

Are you wanting to convert to a polyline to get a tighter bounding box?

 

If so like SEANT61 suggested  just add to check  the X and Y value and update some variable's value for X and Y min max value

You can also find your answers @ TheSwamp

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community