public void ExportEntity(ExpBlock block, PicEntity entity) { PicTypedDrawable drawable = entity as PicTypedDrawable; ExpLayer layer = null; ExpPen pen = null; if (null != drawable) { pen = _exporter.GetPenByAttribute(LineTypeToExpPen(drawable.LineType)); layer = _exporter.GetLayerByName(string.Format("Layer {0}", drawable.Layer)); } PicSegment seg = entity as PicSegment; if (null != seg) { _exporter.AddSegment(block, layer, pen, seg.Pt0.X, seg.Pt0.Y, seg.Pt1.X, seg.Pt1.Y); } PicArc arc = entity as PicArc; if (null != arc) { // using dxf conversions double ang = arc.AngleEnd - arc.AngleBeg, angd = arc.AngleBeg, ango = arc.AngleEnd - arc.AngleBeg; if (ang < 0.0) { angd += ang; ango = -ang; } else { ango = ang; } _exporter.AddArc(block, layer, pen, arc.Center.X, arc.Center.Y, arc.Radius, angd, angd + ango); } }
public void ExportEntity(ExpBlock block, PicEntity entity) { PicTypedDrawable drawable = entity as PicTypedDrawable; ExpLayer layer = null; ExpPen pen = null; if (null != drawable) { pen = _exporter.GetPenByAttribute(LineTypeToExpPen(drawable.LineType)); layer = _exporter.GetLayerByName(string.Format("Layer {0}", drawable.Layer)); } PicSegment seg = entity as PicSegment; if (null != seg) { _exporter.AddSegment(block, layer, pen, seg.Pt0.X, seg.Pt0.Y, seg.Pt1.X, seg.Pt1.Y); } PicArc arc = entity as PicArc; if (null != arc) { // using dxf conversions double ang = arc.AngleEnd - arc.AngleBeg, angd = arc.AngleBeg, ango = arc.AngleEnd - arc.AngleBeg; if (ang < 0.0) { angd += ang; ango = -ang; } else { ango = ang; } _exporter.AddArc(block, layer, pen, arc.Center.X, arc.Center.Y, arc.Radius, angd, angd + ango); } PicCotationDistance cotation = drawable as PicCotationDistance; if (null != cotation) { List <Segment> segments = new List <Segment>(); Vector2D textPt = Vector2D.Zero; double textSize = 0.0; cotation.DrawSeg(ref segments, ref textPt, ref textSize); foreach (Segment cotSeg in segments) { _exporter.AddSegment(block, layer, pen, cotSeg.P0.X, cotSeg.P0.Y, cotSeg.P1.X, cotSeg.P1.Y); } _exporter.AddText(block, layer, pen, textPt.X, textPt.Y, cotation.Text); } }