create polyline circle

create polyline circle

wang890
Collaborator Collaborator
904 Views
1 Reply
Message 1 of 2

create polyline circle

wang890
Collaborator
Collaborator

say i can calculate the coordinate of the 4 quandrant points of a circle 

 

how do you create arcs and convert to polyline that's point together? 

 

or simpler just create polyline with arc segments?

 

see picture. haven't program for a long time and mind is blanked out.

 

picture on the left shows 4 points which i can calculate. picture on the right is what i need to create as polyline segments that's one polyline and then using civil 3d api code to take over and convert to a featureline so people can use it for grading or something.

Stantec
Dell Precision 5530, Prism M320PU, C3D 14/17/19
0 Likes
905 Views
1 Reply
Reply (1)
Message 2 of 2

_gile
Consultant
Consultant

Hi,

 

You can try this way:

 

Polyline pline = new Polyline(2);
pline.AddVertexAt(0, new Point2d(center.X + radius, center.Y), 1.0, 0.0, 0.0);
pline.AddVertexAt(1, new Point2d(center.X - radius, center.Y), 1.0, 0.0, 0.0);
pline.Closed = true;


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes