Ejemplo n.º 1
0
 private Beam()
 {
     this.Name            = "Belka 01";
     this.Height          = 50;
     this.Width           = 25;
     this.Cover           = 2;
     this.DimensionStyles = DimensionStyles.Create();
 }
Ejemplo n.º 2
0
 public static DimensionStyles Create()
 {
     if (I == null)
     {
         I = new DimensionStyles();
     }
     return(I);
 }
Ejemplo n.º 3
0
        private void EnsureTableItems()
        {
            var existingDimStyles = GetExistingNames(DimensionStyles.Cast <DxfSymbolTableFlags>());

            AddMissingDimensionStyles(existingDimStyles, new[] { Header.DimensionStyleName });
            AddMissingDimensionStyles(existingDimStyles, Entities.OfType <DxfDimensionBase>().Select(d => d.DimensionStyleName));
            AddMissingDimensionStyles(existingDimStyles, Entities.OfType <DxfLeader>().Select(d => d.DimensionStyleName));
            AddMissingDimensionStyles(existingDimStyles, Entities.OfType <DxfTolerance>().Select(d => d.DimensionStyleName));

            var existingLayers = GetExistingNames(Layers.Cast <DxfSymbolTableFlags>());

            AddMissingLayers(existingLayers, new[] { Header.CurrentLayer });
            AddMissingLayers(existingLayers, Blocks.Select(b => b.Layer));
            AddMissingLayers(existingLayers, Blocks.SelectMany(b => b.Entities.Select(e => e.Layer)));
            AddMissingLayers(existingLayers, Entities.Select(e => e.Layer));
            AddMissingLayers(existingLayers, Objects.OfType <DxfLayerFilter>().SelectMany(l => l.LayerNames));
            AddMissingLayers(existingLayers, Objects.OfType <DxfLayerIndex>().SelectMany(l => l.LayerNames));

            var existingLineTypes = GetExistingNames(LineTypes.Cast <DxfSymbolTableFlags>());

            AddMissingLineTypes(existingLineTypes, new[] { Header.CurrentEntityLineType, Header.DimensionLineType });
            AddMissingLineTypes(existingLineTypes, Layers.Select(l => l.LineTypeName));
            AddMissingLineTypes(existingLineTypes, Blocks.SelectMany(b => b.Entities.Select(e => e.LineTypeName)));
            AddMissingLineTypes(existingLineTypes, Entities.Select(e => e.LineTypeName));
            AddMissingLineTypes(existingLineTypes, Objects.OfType <DxfMLineStyle>().SelectMany(m => m.Elements.Select(e => e.LineType)));

            var existingStyles = GetExistingNames(Styles.Cast <DxfSymbolTableFlags>());

            AddMissingStyles(existingStyles, Entities.OfType <DxfArcAlignedText>().Select(a => a.TextStyleName));
            AddMissingStyles(existingStyles, Entities.OfType <DxfAttribute>().Select(a => a.TextStyleName));
            AddMissingStyles(existingStyles, Entities.OfType <DxfAttributeDefinition>().Select(a => a.TextStyleName));
            AddMissingStyles(existingStyles, Entities.OfType <DxfMText>().Select(m => m.TextStyleName));
            AddMissingStyles(existingStyles, Entities.OfType <DxfText>().Select(t => t.TextStyleName));
            AddMissingStyles(existingStyles, Objects.OfType <DxfMLineStyle>().Select(m => m.StyleName));

            var existingUcs = GetExistingNames(UserCoordinateSystems.Cast <DxfSymbolTableFlags>());

            AddMissingUcs(existingUcs, new[] {
                Header.UCSDefinitionName,
                Header.UCSName,
                Header.OrthoUCSReference,
                Header.PaperspaceUCSDefinitionName,
                Header.PaperspaceUCSName,
                Header.PaperspaceOrthoUCSReference,
            });

            var existingAppIds = GetExistingNames(ApplicationIds.Cast <DxfSymbolTableFlags>());

            AddMissingAppIds(existingAppIds, Entities.SelectMany(e => e.XData.Keys));
            AddMissingAppIds(existingAppIds, Objects.SelectMany(o => o.XData.Keys));
            AddMissingAppIds(existingAppIds, Blocks.SelectMany(b => b.XData.Keys));

            // don't need to do anything special for BlockRecords or ViewPorts
        }
Ejemplo n.º 4
0
        private void AddDefaultObjects()
        {
            // collections
            this.vports        = new VPorts(this);
            this.views         = new Views(this);
            this.appRegistries = new ApplicationRegistries(this);
            this.layers        = new Layers(this);
            this.lineTypes     = new LineTypes(this);
            this.textStyles    = new TextStyles(this);
            this.dimStyles     = new DimensionStyles(this);
            this.mlineStyles   = new MLineStyles(this);
            this.ucss          = new UCSs(this);
            this.blocks        = new BlockRecords(this);
            this.imageDefs     = new ImageDefinitions(this);
            this.groups        = new Groups(this);
            this.layouts       = new Layouts(this);

            //add default viewport
            this.vports.Add(VPort.Active);

            //add default layer
            this.layers.Add(Layer.Default);

            // add default line types
            this.lineTypes.Add(LineType.ByLayer);
            this.lineTypes.Add(LineType.ByBlock);
            this.lineTypes.Add(LineType.Continuous);

            // add default text style
            this.textStyles.Add(TextStyle.Default);

            // add default application registry
            this.appRegistries.Add(ApplicationRegistry.Default);

            // add default dimension style
            this.dimStyles.Add(DimensionStyle.Default);

            // add default MLine style
            this.mlineStyles.Add(MLineStyle.Default);

            // add ModelSpace layout
            this.layouts.Add(Layout.ModelSpace);

            // raster variables
            this.RasterVariables = new RasterVariables();
        }
Ejemplo n.º 5
0
 private void AddMissingDimensionStyles(HashSet <string> existingDimensionStyles, IEnumerable <string> dimensionStylesToAdd)
 {
     AddMissingTableItems <DxfDimStyle>(existingDimensionStyles, dimensionStylesToAdd, name => new DxfDimStyle(name), ds => DimensionStyles.Add(ds));
 }
Ejemplo n.º 6
0
        private void AddDefaultObjects()
        {
            // collections
            this.vports = new VPorts(this);
            this.views = new Views(this);
            this.appRegistries = new ApplicationRegistries(this);
            this.layers = new Layers(this);
            this.linetypes = new Linetypes(this);
            this.textStyles = new TextStyles(this);
            this.dimStyles = new DimensionStyles(this);
            this.mlineStyles = new MLineStyles(this);
            this.ucss = new UCSs(this);
            this.blocks = new BlockRecords(this);
            this.imageDefs = new ImageDefinitions(this);
            this.underlayDgnDefs = new UnderlayDgnDefinitions(this);
            this.underlayDwfDefs = new UnderlayDwfDefinitions(this);
            this.underlayPdfDefs = new UnderlayPdfDefinitions(this);
            this.groups = new Groups(this);
            this.layouts = new Layouts(this);

            //add default viewport (the active viewport is automatically added when the collection is created, is the only one supported)
            //this.vports.Add(VPort.Active);

            //add default layer
            this.layers.Add(Layer.Default);

            // add default line types
            this.linetypes.Add(Linetype.ByLayer);
            this.linetypes.Add(Linetype.ByBlock);
            this.linetypes.Add(Linetype.Continuous);

            // add default text style
            this.textStyles.Add(TextStyle.Default);

            // add default application registry
            this.appRegistries.Add(ApplicationRegistry.Default);

            // add default dimension style
            this.dimStyles.Add(DimensionStyle.Default);

            // add default MLine style
            this.mlineStyles.Add(MLineStyle.Default);

            // add ModelSpace layout
            this.layouts.Add(Layout.ModelSpace);

            // raster variables
            this.RasterVariables = new RasterVariables();
        }