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(); }
private void AssignHandles(DwgObjectMap objectMap) { BlockHeaders.ClearHandles(); Layers.ClearHandles(); Styles.ClearHandles(); LineTypes.ClearHandles(); Views.ClearHandles(); UCSs.ClearHandles(); ViewPorts.ClearHandles(); AppIds.ClearHandles(); DimStyles.ClearHandles(); ViewPortEntityHeaders.ClearHandles(); GroupDictionary.ClearHandles(); MLineStyleDictionary.ClearHandles(); NamedObjectDictionary.ClearHandles(); BlockHeaders.AssignHandles(objectMap); Layers.AssignHandles(objectMap); Styles.AssignHandles(objectMap); LineTypes.AssignHandles(objectMap); Views.AssignHandles(objectMap); UCSs.AssignHandles(objectMap); ViewPorts.AssignHandles(objectMap); AppIds.AssignHandles(objectMap); DimStyles.AssignHandles(objectMap); ViewPortEntityHeaders.AssignHandles(objectMap); GroupDictionary.AssignHandles(objectMap); MLineStyleDictionary.AssignHandles(objectMap); NamedObjectDictionary.AssignHandles(objectMap); Variables.BlockControlObjectHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, BlockHeaders.Handle.HandleOrOffset); Variables.LayerControlObjectHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, Layers.Handle.HandleOrOffset); Variables.StyleObjectControlHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, Styles.Handle.HandleOrOffset); Variables.LineTypeObjectControlHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, LineTypes.Handle.HandleOrOffset); Variables.ViewControlObjectHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, Views.Handle.HandleOrOffset); Variables.UcsControlObjectHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, UCSs.Handle.HandleOrOffset); Variables.ViewPortControlObjectHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, ViewPorts.Handle.HandleOrOffset); Variables.AppIdControlObjectHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, AppIds.Handle.HandleOrOffset); Variables.DimStyleControlObjectHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, DimStyles.Handle.HandleOrOffset); Variables.ViewPortEntityHeaderControlObjectHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, ViewPortEntityHeaders.Handle.HandleOrOffset); Variables.GroupDictionaryHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, GroupDictionary.Handle.HandleOrOffset); Variables.MLineStyleDictionaryHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, MLineStyleDictionary.Handle.HandleOrOffset); Variables.NamedObjectsDictionaryHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftPointer, NamedObjectDictionary.Handle.HandleOrOffset); Variables.PaperSpaceBlockRecordHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, PaperSpaceBlockRecord.Handle.HandleOrOffset); Variables.ModelSpaceBlockRecordHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, ModelSpaceBlockRecord.Handle.HandleOrOffset); Variables.ByLayerLineTypeHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, ByLayerLineType.Handle.HandleOrOffset); Variables.ByBlockLineTypeHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, ByBlockLineType.Handle.HandleOrOffset); Variables.ContinuousLineTypeHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, ContinuousLineType.Handle.HandleOrOffset); Variables.CurrentViewPortEntityHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, CurrentViewPort?.Handle.HandleOrOffset ?? 0); Variables.CurrentLayerHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, CurrentLayer.Handle.HandleOrOffset); Variables.TextStyleHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, TextStyle.Handle.HandleOrOffset); Variables.CurrentEntityLineTypeHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, CurrentEntityLineType.Handle.HandleOrOffset); Variables.DimensionStyleHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, DimensionStyle.Handle.HandleOrOffset); Variables.CurrentMultiLineStyleHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, CurrentMultiLineStyle.Handle.HandleOrOffset); Variables.PaperSpaceCurrentUCSHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, PaperSpaceCurrentUCS?.Handle.HandleOrOffset ?? 0); Variables.CurrentUCSHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, CurrentUCS?.Handle.HandleOrOffset ?? 0); Variables.DimensionTextStyleHandle = new DwgHandleReference(DwgHandleReferenceCode.SoftOwner, DimensionTextStyle.Handle.HandleOrOffset); objectMap.SetNextAvailableHandle(Variables); }
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(); }