Exemple #1
0
        internal static DxfObject FromBuffer(DxfCodePairBufferReader buffer)
        {
            var first = buffer.Peek();

            buffer.Advance();
            DxfObject obj;

            switch (first.StringValue)
            {
            case "ACAD_PROXY_OBJECT":
                obj = new DxfAcadProxyObject();
                break;

            case "ACDBDICTIONARYWDFLT":
                obj = new DxfDictionaryWithDefault();
                break;

            case "ACDBPLACEHOLDER":
                obj = new DxfPlaceHolder();
                break;

            case "DATATABLE":
                obj = new DxfDataTable();
                break;

            case "DICTIONARY":
                obj = new DxfDictionary();
                break;

            case "DICTIONARYVAR":
                obj = new DxfDictionaryVariable();
                break;

            case "DIMASSOC":
                obj = new DxfDimensionAssociativity();
                break;

            case "FIELD":
                obj = new DxfField();
                break;

            case "GEODATA":
                obj = new DxfGeoData();
                break;

            case "GROUP":
                obj = new DxfGroup();
                break;

            case "IDBUFFER":
                obj = new DxfIdBuffer();
                break;

            case "IMAGEDEF":
                obj = new DxfImageDefinition();
                break;

            case "IMAGEDEF_REACTOR":
                obj = new DxfImageDefinitionReactor();
                break;

            case "LAYER_FILTER":
                obj = new DxfLayerFilter();
                break;

            case "LAYER_INDEX":
                obj = new DxfLayerIndex();
                break;

            case "LAYOUT":
                obj = new DxfLayout();
                break;

            case "LIGHTLIST":
                obj = new DxfLightList();
                break;

            case "MATERIAL":
                obj = new DxfMaterial();
                break;

            case "MLEADERSTYLE":
                obj = new DxfMLeaderStyle();
                break;

            case "MLINESTYLE":
                obj = new DxfMLineStyle();
                break;

            case "OBJECT_PTR":
                obj = new DxfObjectPointer();
                break;

            case "PLOTSETTINGS":
                obj = new DxfPlotSettings();
                break;

            case "RASTERVARIABLES":
                obj = new DxfRasterVariables();
                break;

            case "MENTALRAYRENDERSETTINGS":
                obj = new DxfMentalRayRenderSettings();
                break;

            case "RENDERENVIRONMENT":
                obj = new DxfRenderEnvironment();
                break;

            case "RENDERGLOBAL":
                obj = new DxfRenderGlobal();
                break;

            case "SECTIONMANAGER":
                obj = new DxfSectionManager();
                break;

            case "SECTIONSETTINGS":
                obj = new DxfSectionSettings();
                break;

            case "SORTENTSTABLE":
                obj = new DxfSortentsTable();
                break;

            case "SPATIAL_FILTER":
                obj = new DxfSpatialFilter();
                break;

            case "SPATIAL_INDEX":
                obj = new DxfSpatialIndex();
                break;

            case "SUNSTUDY":
                obj = new DxfSunStudy();
                break;

            case "TABLESTYLE":
                obj = new DxfTableStyle();
                break;

            case "UNDERLAYDEFINITION":
                obj = new DxfUnderlayDefinition();
                break;

            case "VBA_PROJECT":
                obj = new DxfVbaProject();
                break;

            case "VISUALSTYLE":
                obj = new DxfVisualStyle();
                break;

            case "WIPEOUTVARIABLES":
                obj = new DxfWipeoutVariables();
                break;

            case "XRECORD":
                obj = new DxfXRecordObject();
                break;

            default:
                SwallowObject(buffer);
                obj = null;
                break;
            }

            if (obj != null)
            {
                obj = obj.PopulateFromBuffer(buffer);
            }

            return(obj);
        }
Exemple #2
0
 public void WriteSortentsTableTest()
 {
     var sortents = new DxfSortentsTable();
     sortents.EntityHandles.Add(0x2000u);
     sortents.EntityHandles.Add(0x2001u);
     sortents.EntityHandles.Add(0x2002u);
     sortents.SortHandles.Add(0x3000u);
     sortents.SortHandles.Add(0x3001u);
     sortents.SortHandles.Add(0x3002u);
     var file = new DxfFile();
     file.Objects.Add(sortents);
     VerifyFileContains(file, @"
       0
     SORTENTSTABLE
       5
     A
     100
     AcDbSortentsTable
     331
     2000
     331
     2001
     331
     2002
       5
     3000
       5
     3001
       5
     3002
     ");
 }