예제 #1
0
        //--------------------------------------------------------------------------------------------------

        void _AddEntity(DxfDomEntity entity)
        {
            if (_CurrentBlock != null)
            {
                _CurrentBlock.Entities.Add(entity);
            }
            else
            {
                _Document.Entities.Add(entity);
            }
        }
예제 #2
0
        //--------------------------------------------------------------------------------------------------

        void _ImportEntity(DxfDomEntity entity)
        {
            switch (entity)
            {
            case DxfDomLine line:
                _ImportLine(line);
                break;

            case DxfDomCircle circle:
                if (circle.IsArc)
                {
                    _ImportArc(circle);
                }
                else
                {
                    _ImportCircle(circle);
                }
                break;

            case DxfDomEllipse ellipse:
                if (ellipse.IsArc)
                {
                    _ImportEllipticalArc(ellipse);
                }
                else
                {
                    _ImportEllipse(ellipse);
                }
                break;

            case DxfDomLwPolyline lwPolyline:
                _ImportLwPolyline(lwPolyline);
                break;

            case DxfDomPolyline polyline:
                _ImportPolyline(polyline);
                break;

            case DxfDomSpline spline:
                _ImportSpline(spline);
                break;

            default:
                Messages.Warning($"Imported DXF entity is of unsupported type {entity.GetType().Name}.");
                break;
            }
        }