DXFVertex first = new DXFVertex(this.start);
DXFVertex first = new DXFVertex(this.startPoint);
	public void createDXFPolyline(DXFLayer layer) {		// create the polyline and remove the entity		DXFPolyline pline = new DXFPolyline();		DXFVertex first = new DXFVertex(this.start);		pline.addVertex(first);		Iterator i = this.elements.iterator();		while (i.hasNext()) {			DXFEntity e = (DXFEntity) i.next();									if (DXFConstants.ENTITY_TYPE_LINE.equals( e.getType() )) {								DXFLine line = (DXFLine) e;				first = new DXFVertex(line.getEndPoint());				pline.addVertex(first);							} else if (DXFConstants.ENTITY_TYPE_POLYLINE.equals( e.getType() )					|| DXFConstants.ENTITY_TYPE_LWPOLYLINE.equals( e.getType() )) {								DXFPolyline pl = (DXFPolyline) e;				double bulge = pl.getVertex(0).getBulge();				if (bulge != 0.0) {					first.setBulge(bulge);				}				for (int x = 1; x < pl.getVertexCount(); x++) {					first = pl.getVertex(x);					pline.addVertex(first);				}							} else if (DXFConstants.ENTITY_TYPE_ARC.equals( e.getType() )) {				DXFArc arc = (DXFArc) e;				if (arc.getTotalAngle() > 0.0) {					double h = arc.getRadius()							* (1 - Math.cos(Math									.toRadians(arc.getTotalAngle() / 2)));					 double  chordLength= arc.getChordLength();					if (arc.getStartPoint().equals(first.getPoint())) {						// the last point is our start point,						// which is always set						// we have to calculate the bulge						first.setBulge(2 * h / chordLength);						first = new DXFVertex(arc.getEndPoint());						pline.addVertex(first);					} else {						// reverse the arc, we change the start/end points						// and set the bulge to >0						first.setBulge(-1.0 * (2 * h / chordLength));							first = new DXFVertex(arc.getStartPoint());						pline.addVertex(first);					}				}			}			// remove from layer			layer.removeDXFEntity(e);		}		// add the new polyline to the layer		pline.setLayerName(layer.getName());		layer.addDXFEntity(pline);	}