Page 1 of 1

CADVertex ouput problem

Posted: 09 Jul 2019, 09:42
by dlwotj4274
Hello

I got polylines from block

and polyines's vertexes.

I made a list for each values of point x and point y from vertexs.

I would like to write these values in console.

It is a code that I wrote. I'm having a difficult to approach CADVertex Class.



if (block.Entities.EntType == EntityType.LWPolyline)
{
CADLWPolyLine PolylinesData = (CADLWPolyLine)block.Entities;

List<CADVertex> vertexes = new List<CADVertex>();
PolylinesData.Vertexes.ForEach(ent => vertexes.Add(ent as CADVertex));
vertexes.ForEach(Console.WriteLine);
}

Thanks!

Re: CADVertex ouput problem

Posted: 09 Jul 2019, 21:18
by support
Hello,

To write the Point.X and Point.Y values from a CADVertex object in the console, use the following code:

Code: Select all

vertexes.ForEach(vertex => Console.WriteLine("x={0}; y={1}", vertex.Point.X, vertex.Point.Y));
Mikhail