Closed LwPolyline

Dec 11, 2012 at 3:12 PM


for closed polyline, you need to read code 70, but this code can store other information (128 for example for line type generation on each vertice).

So to find if polyline is closed, it's better to use

pol.IsClosed = (int

.Parse(dxfPairInfo.Value) & 1) == 1


instead of testing 0 or non 0 value


Dec 12, 2012 at 1:03 PM
Edited Dec 12, 2012 at 1:03 PM

Yes, you are right, that was a bug, I will upload the fix on the next commit. The proper way should be to check code 70 value against the flag, a more verbose solution is:

PolylineTypeFlags flags = (PolylineTypeFlags)int.Parse(dxfPairInfo.Value);
pol.IsClosed = (flags & PolylineTypeFlags.ClosedPolylineOrClosedPolygonMeshInM) == PolylineTypeFlags.ClosedPolylineOrClosedPolygonMeshInM;