if (layer.hasDXFEntities(DXFConstants.ENTITY_TYPE_POLYLINE)) {
List<DXFEntity> l = layer.getDXFEntities(DXFConstants.ENTITY_TYPE_POLYLINE);
Iterator<DXFEntity> i = l.iterator();
while (i.hasNext()) {
DXFPolyline pl = (DXFPolyline) i.next();
if (!pl.isClosed() && !pl.is3DPolygonMesh() &&
!pl.isClosedMeshMDirection() &&
!pl.isClosedMeshNDirection() &&
!pl.isCubicSurefaceMesh()) {
Point start = pl.getVertex(0).getPoint();
Point end = pl.getVertex(pl.getVertexCount() - 1).getPoint();
checkDXFEntity(pl, start, end);
}
}
}
// check the lwpolylines
if (layer.hasDXFEntities(DXFConstants.ENTITY_TYPE_LWPOLYLINE)) {
List<DXFEntity> l = layer.getDXFEntities(DXFConstants.ENTITY_TYPE_LWPOLYLINE);
Iterator<DXFEntity> i = l.iterator();
while (i.hasNext()) {
DXFLWPolyline pl = (DXFLWPolyline) i.next();
if (!pl.isClosed() && !pl.is3DPolygonMesh() &&
!pl.isClosedMeshMDirection() &&
!pl.isClosedMeshNDirection() &&
!pl.isCubicSurefaceMesh()) {
Point start = pl.getVertex(0).getPoint();
Point end = pl.getVertex(pl.getVertexCount() - 1).getPoint();
checkDXFEntity(pl, start, end);
}
}
}