Polylines are all(0, 0, 1)

Jul 27 at 9:07 AM
Thank you for your great job! XD

I load dxf file.

And try to extract each polylines xyz.

so I made a code like this, but all the results are just (0, 0, 1)
and I dont know why.

Please, let me know what did I wrong.

ps. sorry for my bad eng.

DxfDocument _dxf = DxfDocument.Load(ofd.FileName);

if (dxf == null)
return;
if (dxf.Polylines.Count > 0)
{
foreach(Polyline polyline in dxf.Polylines)
{

    Console.WriteLine($"{polyline.Normal.X}, {polyline.Normal.Y}, {polyline.Normal.Z}");

}
}
Coordinator
Jul 31 at 11:10 PM
The normal vector of an entity specifies the plane in which they are defined. Without going into details, it is common for an entity that is purely three dimensional, such as the polylines (the ones you are reading), 3d faces, lines,..., to have its normal as the vector Z, since the XY plane is the default one. Other entities such as circles, arcs, lwpolylines, ... are entities that are contained into a plane and therefore the value of its normal is a lot more important.

What kind of information are you looking for? Because from: "And try to extract each polylines xyz." I assume you are looking for its vertexes, and you will find them in the vertexes list of the polyline.

Daniel