From 176728117273d15535d633cc0f0aadfb90022c4a Mon Sep 17 00:00:00 2001 From: DomCR Date: Fri, 6 Sep 2024 13:23:46 +0200 Subject: [PATCH 01/16] docs --- src/ACadSharp/Objects/PlotSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ACadSharp/Objects/PlotSettings.cs b/src/ACadSharp/Objects/PlotSettings.cs index f58a8c8e..171c647e 100644 --- a/src/ACadSharp/Objects/PlotSettings.cs +++ b/src/ACadSharp/Objects/PlotSettings.cs @@ -159,7 +159,7 @@ public double DenominatorScale public PlotPaperUnits PaperUnits { get; set; } = PlotPaperUnits.Milimeters; /// - /// Plot paper units. + /// Plot paper rotation. /// [DxfCodeValue(73)] public PlotRotation PaperRotation { get; set; } From 2468efdec3641e328ad85dd716110ea5353857a0 Mon Sep 17 00:00:00 2001 From: DomCR Date: Fri, 6 Sep 2024 16:25:39 +0200 Subject: [PATCH 02/16] paper viewport --- src/ACadSharp/Entities/ViewPort.cs | 43 +++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/src/ACadSharp/Entities/ViewPort.cs b/src/ACadSharp/Entities/ViewPort.cs index 17049b09..fd96dfed 100644 --- a/src/ACadSharp/Entities/ViewPort.cs +++ b/src/ACadSharp/Entities/ViewPort.cs @@ -17,6 +17,11 @@ namespace ACadSharp.Entities [DxfSubClass(DxfSubclassMarker.Viewport)] public class Viewport : Entity { + /// + /// Paper view Id, it indicates that the viewport acts as a paper size. + /// + public const int PaperViewId = 1; + /// public override ObjectType ObjectType => ObjectType.VIEWPORT; @@ -45,10 +50,32 @@ public class Viewport : Entity public double Height { get; set; } /// - /// Viewport ID + /// Viewport ID. /// + /// + /// The first value for a PaperSpace will represent the paper image in the screen. + /// [DxfCodeValue(69)] - public short Id { get; set; } = 1; + public short Id + { + get + { + if (this.Owner is BlockRecord record) + { + short id = 0; + foreach (Viewport viewport in record.Viewports) + { + id += 1; + if (viewport == this) + { + return id; + } + } + } + + return 0; + } + } /// /// View center point(in DCS) @@ -286,6 +313,14 @@ public class Viewport : Entity //Soft pointer reference to viewport object (for layer VP property override) + public bool RepresentsPaper + { + get + { + return this.Id == PaperViewId; + } + } + /// public override CadObject Clone() { @@ -299,8 +334,8 @@ public override CadObject Clone() /// public override BoundingBox GetBoundingBox() { - XYZ min = new XYZ(Center.X - this.Width, Center.Y - this.Height, Center.Z); - XYZ max = new XYZ(Center.X + this.Width, Center.Y + this.Height, Center.Z); + XYZ min = new XYZ(this.Center.X - this.Width / 2, this.Center.Y - this.Height / 2, this.Center.Z); + XYZ max = new XYZ(this.Center.X + this.Width / 2, this.Center.Y + this.Height / 2, this.Center.Z); return new BoundingBox(min, max); } From cefd37e89b055145ae32da9e90188686fb8061bf Mon Sep 17 00:00:00 2001 From: DomCR Date: Thu, 19 Sep 2024 10:21:44 +0200 Subject: [PATCH 03/16] layer color --- src/ACadSharp/Tables/Layer.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ACadSharp/Tables/Layer.cs b/src/ACadSharp/Tables/Layer.cs index 40b6639f..d7524de6 100644 --- a/src/ACadSharp/Tables/Layer.cs +++ b/src/ACadSharp/Tables/Layer.cs @@ -46,7 +46,19 @@ public class Layer : TableEntry /// if the index is negative, layer is off /// [DxfCodeValue(62, 420, 430)] - public Color Color { get; set; } = new Color(7); + public Color Color + { + get { return this._color; } + set + { + if (value.IsByLayer || value.IsByBlock) + { + throw new ArgumentException("The layer color cannot be ByLayer or ByBlock", nameof(value)); + } + + this._color = value; + } + } /// /// The linetype of an object. The default linetype is the linetype of the layer (ByLayer). @@ -104,6 +116,8 @@ public LineType LineType private LineType _lineType = LineType.Continuous; + private Color _color = new Color(7); + internal Layer() : base() { } public Layer(string name) : base(name) { } From 4242b448f6fe3a889ef50dd67b65519425ab273b Mon Sep 17 00:00:00 2001 From: DomCR Date: Thu, 19 Sep 2024 15:27:58 +0200 Subject: [PATCH 04/16] spelling --- src/ACadSharp/Entities/ViewPort.cs | 8 ++++---- .../IO/DWG/DwgStreamReaders/DwgObjectReader.cs | 2 +- .../DwgStreamWriters/DwgObjectWriter.Entities.cs | 4 ++-- .../DwgStreamWriters/DwgObjectWriter.Objects.cs | 2 +- .../IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs | 2 +- .../DxfSectionWriterBase.Entities.cs | 6 +++--- src/ACadSharp/IO/Templates/CadLayoutTemplate.cs | 4 ++-- src/ACadSharp/IO/Templates/CadViewportTemplate.cs | 6 +++--- src/ACadSharp/Objects/Layout.cs | 8 ++++---- src/ACadSharp/Tables/BlockRecord.cs | 14 +++++++------- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/ACadSharp/Entities/ViewPort.cs b/src/ACadSharp/Entities/ViewPort.cs index fd96dfed..c50b1e8b 100644 --- a/src/ACadSharp/Entities/ViewPort.cs +++ b/src/ACadSharp/Entities/ViewPort.cs @@ -7,7 +7,7 @@ namespace ACadSharp.Entities { /// - /// Represents a entity. + /// Represents a entity. /// /// /// Object name
@@ -15,7 +15,7 @@ namespace ACadSharp.Entities ///
[DxfName(DxfFileToken.EntityViewport)] [DxfSubClass(DxfSubclassMarker.Viewport)] - public class Viewport : Entity + public class ViewPort : Entity { /// /// Paper view Id, it indicates that the viewport acts as a paper size. @@ -63,7 +63,7 @@ public short Id if (this.Owner is BlockRecord record) { short id = 0; - foreach (Viewport viewport in record.Viewports) + foreach (ViewPort viewport in record.ViewPorts) { id += 1; if (viewport == this) @@ -324,7 +324,7 @@ public bool RepresentsPaper /// public override CadObject Clone() { - Viewport clone = (Viewport)base.Clone(); + ViewPort clone = (ViewPort)base.Clone(); clone.VisualStyle = (VisualStyle)this.VisualStyle?.Clone(); diff --git a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs index dac09e25..ae1328bc 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs @@ -2213,7 +2213,7 @@ private CadTemplate readShape() private CadTemplate readViewport() { - Viewport viewport = new Viewport(); + ViewPort viewport = new ViewPort(); CadViewportTemplate template = new CadViewportTemplate(viewport); //Common Entity Data diff --git a/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs b/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs index f92c4c62..9a4d3bd0 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs @@ -174,7 +174,7 @@ private void writeEntity(Entity entity) throw new NotImplementedException($"Vertex not implemented : {entity.GetType().FullName}"); } break; - case Viewport viewport: + case ViewPort viewport: this.writeViewport(viewport); break; case XLine xline: @@ -2264,7 +2264,7 @@ private void writeTolerance(Tolerance tolerance) this._writer.HandleReference(DwgReferenceType.HardPointer, tolerance.Style); } - private void writeViewport(Viewport viewport) + private void writeViewport(ViewPort viewport) { //Center 3BD 10 this._writer.Write3BitDouble(viewport.Center); diff --git a/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Objects.cs b/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Objects.cs index c36ac818..5de3b61f 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Objects.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Objects.cs @@ -263,7 +263,7 @@ private void writeLayout(Layout layout) //R2004+: if (this.R2004Plus) { - foreach (Entities.Viewport viewport in layout.Viewports) + foreach (Entities.ViewPort viewport in layout.Viewports) { //Viewport handle(repeats Viewport count times) (soft pointer) this._writer.HandleReference(DwgReferenceType.SoftPointer, viewport); diff --git a/src/ACadSharp/IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs b/src/ACadSharp/IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs index 26030894..1801a55f 100644 --- a/src/ACadSharp/IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs +++ b/src/ACadSharp/IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs @@ -189,7 +189,7 @@ protected CadEntityTemplate readEntity() case DxfFileToken.EntityVertex: return this.readEntityCodes(new CadVertexTemplate(), this.readVertex); case DxfFileToken.EntityViewport: - return this.readEntityCodes(new CadViewportTemplate(), this.readViewport); + return this.readEntityCodes(new CadViewportTemplate(), this.readViewport); case DxfFileToken.EntityShape: return this.readEntityCodes(new CadShapeTemplate(new Shape()), this.readShape); case DxfFileToken.EntitySpline: diff --git a/src/ACadSharp/IO/DXF/DxfStreamWriter/DxfSectionWriterBase.Entities.cs b/src/ACadSharp/IO/DXF/DxfStreamWriter/DxfSectionWriterBase.Entities.cs index c3c679d2..dd74e768 100644 --- a/src/ACadSharp/IO/DXF/DxfStreamWriter/DxfSectionWriterBase.Entities.cs +++ b/src/ACadSharp/IO/DXF/DxfStreamWriter/DxfSectionWriterBase.Entities.cs @@ -101,7 +101,7 @@ protected void writeEntity(T entity) case Vertex vertex: this.writeVertex(vertex); break; - case Viewport viewport: + case ViewPort viewport: this.writeViewport(viewport); break; case Wipeout wipeout: @@ -1152,9 +1152,9 @@ private void writeVertex(Vertex v) this._writer.Write(50, v.CurveTangent, map); } - private void writeViewport(Viewport vp) + private void writeViewport(ViewPort vp) { - DxfClassMap map = DxfClassMap.Create(); + DxfClassMap map = DxfClassMap.Create(); this._writer.Write(DxfCode.Subclass, DxfSubclassMarker.Viewport); diff --git a/src/ACadSharp/IO/Templates/CadLayoutTemplate.cs b/src/ACadSharp/IO/Templates/CadLayoutTemplate.cs index 75ed65bf..d559796d 100644 --- a/src/ACadSharp/IO/Templates/CadLayoutTemplate.cs +++ b/src/ACadSharp/IO/Templates/CadLayoutTemplate.cs @@ -32,7 +32,7 @@ public override void Build(CadDocumentBuilder builder) this.CadObject.AssociatedBlock = record; } - if (builder.TryGetCadObject(this.ActiveViewportHandle, out Viewport viewport)) + if (builder.TryGetCadObject(this.ActiveViewportHandle, out ViewPort viewport)) { this.CadObject.Viewport = viewport; } @@ -49,7 +49,7 @@ public override void Build(CadDocumentBuilder builder) foreach (var handle in this.ViewportHandles) { - if (builder.TryGetCadObject(handle, out Viewport vp)) + if (builder.TryGetCadObject(handle, out ViewPort vp)) { //Is repeated, the viewports are already in the entities list in the BLOCK_RECORD // if(this.CadObject.AssociatedBlock.Viewports.Contains(vp)) diff --git a/src/ACadSharp/IO/Templates/CadViewportTemplate.cs b/src/ACadSharp/IO/Templates/CadViewportTemplate.cs index af13ce1a..d316ffee 100644 --- a/src/ACadSharp/IO/Templates/CadViewportTemplate.cs +++ b/src/ACadSharp/IO/Templates/CadViewportTemplate.cs @@ -20,15 +20,15 @@ internal class CadViewportTemplate : CadEntityTemplate public List FrozenLayerHandles { get; set; } = new List(); - public CadViewportTemplate() : base(new Viewport()) { } + public CadViewportTemplate() : base(new ViewPort()) { } - public CadViewportTemplate(Viewport entity) : base(entity) { } + public CadViewportTemplate(ViewPort entity) : base(entity) { } public override void Build(CadDocumentBuilder builder) { base.Build(builder); - Viewport viewport = this.CadObject as Viewport; + ViewPort viewport = this.CadObject as ViewPort; if (this.ViewportHeaderHandle.HasValue && this.ViewportHeaderHandle > 0) { diff --git a/src/ACadSharp/Objects/Layout.cs b/src/ACadSharp/Objects/Layout.cs index c80b5c95..cf7d3420 100644 --- a/src/ACadSharp/Objects/Layout.cs +++ b/src/ACadSharp/Objects/Layout.cs @@ -143,7 +143,7 @@ internal set /// Viewport that was last active in this layout when the layout was current. /// [DxfCodeValue(DxfReferenceType.Handle, 331)] - public Viewport Viewport + public ViewPort Viewport { get { @@ -189,15 +189,15 @@ public bool IsPaperSpace //333 Shade plot ID - public IEnumerable Viewports + public IEnumerable Viewports { get { - return this.AssociatedBlock?.Viewports; + return this.AssociatedBlock?.ViewPorts; } } - private Viewport _lastViewport; + private ViewPort _lastViewport; private BlockRecord _blockRecord; diff --git a/src/ACadSharp/Tables/BlockRecord.cs b/src/ACadSharp/Tables/BlockRecord.cs index 3fffa4a0..c54bf13b 100644 --- a/src/ACadSharp/Tables/BlockRecord.cs +++ b/src/ACadSharp/Tables/BlockRecord.cs @@ -88,19 +88,19 @@ public static BlockRecord PaperSpace public new BlockTypeFlags Flags { get { return this.BlockEntity.Flags; } set { this.BlockEntity.Flags = value; } } /// - /// Specifies whether the block can be exploded + /// Specifies whether the block can be exploded. /// [DxfCodeValue(DxfReferenceType.Optional, 280)] public bool IsExplodable { get; set; } /// - /// Specifies the scaling allowed for the block + /// Specifies the scaling allowed for the block. /// [DxfCodeValue(DxfReferenceType.Optional, 281)] public bool CanScale { get; set; } = true; /// - /// DXF: Binary data for bitmap preview + /// DXF: Binary data for bitmap preview. /// /// /// Optional @@ -109,7 +109,7 @@ public static BlockRecord PaperSpace public byte[] Preview { get; set; } /// - /// Associated Layout + /// Associated Layout. /// [DxfCodeValue(DxfReferenceType.Handle, 340)] public Layout Layout @@ -144,13 +144,13 @@ public bool HasAttributes } /// - /// Viewports attached to this block + /// ViewPorts attached to this block /// - public IEnumerable Viewports + public IEnumerable ViewPorts { get { - return this.Entities.OfType(); + return this.Entities.OfType(); } } From 403fb4c0babedeab49a2b6b9f9b3d3b43e69b2ee Mon Sep 17 00:00:00 2001 From: DomCR Date: Wed, 25 Sep 2024 11:40:37 +0200 Subject: [PATCH 05/16] spelling --- src/ACadSharp/CadUtils.cs | 68 +++++++++---------- src/ACadSharp/Entities/Entity.cs | 2 +- src/ACadSharp/Entities/IEntity.cs | 2 +- src/ACadSharp/Entities/MultiLeader.cs | 2 +- src/ACadSharp/Header/CadHeader.cs | 6 +- .../DWG/DwgStreamReaders/DwgHeaderReader.cs | 6 +- .../DWG/DwgStreamReaders/DwgObjectReader.cs | 10 +-- .../DxfStreamReader/DxfTablesSectionReader.cs | 4 +- .../Objects/MultiLeaderAnnotContextClasses.cs | 2 +- src/ACadSharp/Objects/MultiLeaderStyle.cs | 2 +- src/ACadSharp/Tables/DimensionStyle.cs | 4 +- src/ACadSharp/Tables/Layer.cs | 2 +- .../{Lineweight.cs => LineWeightType.cs} | 56 +++++++-------- src/CSUtilities | 2 +- 14 files changed, 84 insertions(+), 84 deletions(-) rename src/ACadSharp/Types/{Lineweight.cs => LineWeightType.cs} (57%) diff --git a/src/ACadSharp/CadUtils.cs b/src/ACadSharp/CadUtils.cs index 7db69351..83ae5b4d 100644 --- a/src/ACadSharp/CadUtils.cs +++ b/src/ACadSharp/CadUtils.cs @@ -80,32 +80,32 @@ internal static class CadUtils {"iso8859-15",CodePage.Iso885915}, }; - private static readonly LineweightType[] _indexedValue = new LineweightType[] + private static readonly LineWeightType[] _indexedValue = new LineWeightType[] { - LineweightType.W0, - LineweightType.W5, - LineweightType.W9, - LineweightType.W13, - LineweightType.W15, - LineweightType.W18, - LineweightType.W20, - LineweightType.W25, - LineweightType.W30, - LineweightType.W35, - LineweightType.W40, - LineweightType.W50, - LineweightType.W53, - LineweightType.W60, - LineweightType.W70, - LineweightType.W80, - LineweightType.W90, - LineweightType.W100, - LineweightType.W106, - LineweightType.W120, - LineweightType.W140, - LineweightType.W158, - LineweightType.W200, - LineweightType.W211 + LineWeightType.W0, + LineWeightType.W5, + LineWeightType.W9, + LineWeightType.W13, + LineWeightType.W15, + LineWeightType.W18, + LineWeightType.W20, + LineWeightType.W25, + LineWeightType.W30, + LineWeightType.W35, + LineWeightType.W40, + LineWeightType.W50, + LineWeightType.W53, + LineWeightType.W60, + LineWeightType.W70, + LineWeightType.W80, + LineWeightType.W90, + LineWeightType.W100, + LineWeightType.W106, + LineWeightType.W120, + LineWeightType.W140, + LineWeightType.W158, + LineWeightType.W200, + LineWeightType.W211 }; private static readonly CodePage[] _pageCodes = new CodePage[] @@ -157,38 +157,38 @@ internal static class CadUtils CodePage.Windows1258 }; - public static LineweightType ToValue(byte b) + public static LineWeightType ToValue(byte b) { switch (b) { case 28: case 29: - return LineweightType.ByLayer; + return LineWeightType.ByLayer; case 30: - return LineweightType.ByBlock; + return LineWeightType.ByBlock; case 31: - return LineweightType.Default; + return LineWeightType.Default; default: if (b < 0 || b >= _indexedValue.Length) { - return LineweightType.Default; + return LineWeightType.Default; } return _indexedValue[b]; } } - public static byte ToIndex(LineweightType value) + public static byte ToIndex(LineWeightType value) { byte result = 0; switch (value) { - case LineweightType.Default: + case LineWeightType.Default: result = 31; break; - case LineweightType.ByBlock: + case LineWeightType.ByBlock: result = 30; break; - case LineweightType.ByLayer: + case LineWeightType.ByLayer: result = 29; break; default: diff --git a/src/ACadSharp/Entities/Entity.cs b/src/ACadSharp/Entities/Entity.cs index 0e1d9f2c..3f6b396c 100644 --- a/src/ACadSharp/Entities/Entity.cs +++ b/src/ACadSharp/Entities/Entity.cs @@ -44,7 +44,7 @@ public Layer Layer /// [DxfCodeValue(370)] - public LineweightType LineWeight { get; set; } = LineweightType.ByLayer; + public LineWeightType LineWeight { get; set; } = LineWeightType.ByLayer; /// [DxfCodeValue(48)] diff --git a/src/ACadSharp/Entities/IEntity.cs b/src/ACadSharp/Entities/IEntity.cs index 70b9a812..e15f4b44 100644 --- a/src/ACadSharp/Entities/IEntity.cs +++ b/src/ACadSharp/Entities/IEntity.cs @@ -23,7 +23,7 @@ public interface IEntity : IHandledCadObject /// /// Specifies the lineweight of an individual object or the default lineweight for the drawing. /// - LineweightType LineWeight { get; set; } + LineWeightType LineWeight { get; set; } /// /// Linetype scale for this entity. diff --git a/src/ACadSharp/Entities/MultiLeader.cs b/src/ACadSharp/Entities/MultiLeader.cs index 71daafa9..83163f6b 100644 --- a/src/ACadSharp/Entities/MultiLeader.cs +++ b/src/ACadSharp/Entities/MultiLeader.cs @@ -175,7 +175,7 @@ public object Clone() /// property. /// [DxfCodeValue(171)] - public LineweightType LeaderLineWeight { get; set; } + public LineWeightType LeaderLineWeight { get; set; } /// /// Gets or sets a value indicating whether landing is enabled. diff --git a/src/ACadSharp/Header/CadHeader.cs b/src/ACadSharp/Header/CadHeader.cs index 3f5f6583..a99f8ec4 100644 --- a/src/ACadSharp/Header/CadHeader.cs +++ b/src/ACadSharp/Header/CadHeader.cs @@ -1327,7 +1327,7 @@ public XYZ ModelSpaceYAxis /// System variable CELWEIGHT /// [CadSystemVariable("$CELWEIGHT", 370)] - public LineweightType CurrentEntityLineWeight { get; set; } = LineweightType.ByLayer; + public LineWeightType CurrentEntityLineWeight { get; set; } = LineWeightType.ByLayer; /// /// Lineweight endcaps setting for new objects @@ -2420,7 +2420,7 @@ public double DimensionTextVerticalPosition /// System variable DIMLWD /// [CadSystemVariable("$DIMLWD", 70)] - public LineweightType DimensionLineWeight + public LineWeightType DimensionLineWeight { get { return this.DimensionStyleOverrides.DimensionLineWeight; } set @@ -2436,7 +2436,7 @@ public LineweightType DimensionLineWeight /// System variable DIMLWE /// [CadSystemVariable("$DIMLWE", 70)] - public LineweightType ExtensionLineWeight + public LineWeightType ExtensionLineWeight { get { return this.DimensionStyleOverrides.ExtensionLineWeight; } set diff --git a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgHeaderReader.cs b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgHeaderReader.cs index 30571e41..e441645a 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgHeaderReader.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgHeaderReader.cs @@ -788,9 +788,9 @@ public void Read(int acadMaintenanceVersion, out DwgHeaderHandlesCollection obje if (R2000Plus) { //BS: DIMLWD - _header.DimensionLineWeight = (LineweightType)_reader.ReadBitShort(); + _header.DimensionLineWeight = (LineWeightType)_reader.ReadBitShort(); //BS : DIMLWE - _header.ExtensionLineWeight = (LineweightType)_reader.ReadBitShort(); + _header.ExtensionLineWeight = (LineWeightType)_reader.ReadBitShort(); } //H: BLOCK CONTROL OBJECT(hard owner) @@ -876,7 +876,7 @@ public void Read(int acadMaintenanceVersion, out DwgHeaderHandlesCollection obje //BL: Flags: int flags = _reader.ReadBitLong(); //CELWEIGHT Flags & 0x001F - _header.CurrentEntityLineWeight = (LineweightType)(flags & 0x1F); + _header.CurrentEntityLineWeight = (LineWeightType)(flags & 0x1F); //ENDCAPS Flags & 0x0060 _header.EndCaps = (short)(flags & 0x60); //JOINSTYLE Flags & 0x0180 diff --git a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs index ae1328bc..e567d654 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs @@ -2895,7 +2895,7 @@ private CadTemplate readMultiLeader() template.LeaderLineTypeHandle = this.handleReference(); //BL 171 LeaderLine Weight - mLeader.LeaderLineWeight = (LineweightType)this._objectReader.ReadBitLong(); + mLeader.LeaderLineWeight = (LineWeightType)this._objectReader.ReadBitLong(); //B 290 Enable Landing mLeader.EnableLanding = this._objectReader.ReadBit(); //B 291 Enable Dogleg @@ -3262,7 +3262,7 @@ private LeaderLine readLeaderLine(CadMLeaderTemplate template) // H 340 Line type handle(hard pointer) leaderLineSubTemplate.LineTypeHandle = this.handleReference(); // BL 171 Line weight - leaderLine.LineWeight = (LineweightType)this._objectReader.ReadBitLong(); + leaderLine.LineWeight = (LineWeightType)this._objectReader.ReadBitLong(); // BD 40 Arrow size leaderLine.ArrowheadSize = this._objectReader.ReadBitDouble(); // H 341 Arrow symbol handle(hard pointer) @@ -3308,7 +3308,7 @@ private CadTemplate readMultiLeaderStyle() // H 340 Leader line type handle (hard pointer) template.LeaderLineTypeHandle = this.handleReference(); // BL 92 Leader line weight - mLeaderStyle.LeaderLineWeight = (LineweightType)this._objectReader.ReadBitLong(); + mLeaderStyle.LeaderLineWeight = (LineWeightType)this._objectReader.ReadBitLong(); // B 290 Is landing enabled? mLeaderStyle.EnableLanding = this._objectReader.ReadBit(); // BD 42 Landing gap @@ -4555,9 +4555,9 @@ private CadTemplate readDimStyle() if (this.R2000Plus) { //DIMLWD BS 371 - dimStyle.DimensionLineWeight = (LineweightType)this._objectReader.ReadBitShort(); + dimStyle.DimensionLineWeight = (LineWeightType)this._objectReader.ReadBitShort(); //DIMLWE BS 372 - dimStyle.ExtensionLineWeight = (LineweightType)this._objectReader.ReadBitShort(); + dimStyle.ExtensionLineWeight = (LineWeightType)this._objectReader.ReadBitShort(); } //Common: diff --git a/src/ACadSharp/IO/DXF/DxfStreamReader/DxfTablesSectionReader.cs b/src/ACadSharp/IO/DXF/DxfStreamReader/DxfTablesSectionReader.cs index c1978b2a..96d46db7 100644 --- a/src/ACadSharp/IO/DXF/DxfStreamReader/DxfTablesSectionReader.cs +++ b/src/ACadSharp/IO/DXF/DxfStreamReader/DxfTablesSectionReader.cs @@ -530,10 +530,10 @@ private bool readDimensionStyle(CadTableEntryTemplate template, tmp.DIMBLK2 = this._reader.ValueAsHandle; return true; case 371: - template.CadObject.DimensionLineWeight = (LineweightType)this._reader.ValueAsShort; + template.CadObject.DimensionLineWeight = (LineWeightType)this._reader.ValueAsShort; return true; case 372: - template.CadObject.ExtensionLineWeight = (LineweightType)this._reader.ValueAsShort; + template.CadObject.ExtensionLineWeight = (LineWeightType)this._reader.ValueAsShort; return true; default: return false; diff --git a/src/ACadSharp/Objects/MultiLeaderAnnotContextClasses.cs b/src/ACadSharp/Objects/MultiLeaderAnnotContextClasses.cs index edbbb3f8..82a2354c 100644 --- a/src/ACadSharp/Objects/MultiLeaderAnnotContextClasses.cs +++ b/src/ACadSharp/Objects/MultiLeaderAnnotContextClasses.cs @@ -189,7 +189,7 @@ public LeaderLine() { } /// Line weight /// [DxfCodeValue(171)] - public LineweightType LineWeight { get; set; } + public LineWeightType LineWeight { get; set; } /// /// Arrowhead size diff --git a/src/ACadSharp/Objects/MultiLeaderStyle.cs b/src/ACadSharp/Objects/MultiLeaderStyle.cs index 326ce52b..f347afa3 100644 --- a/src/ACadSharp/Objects/MultiLeaderStyle.cs +++ b/src/ACadSharp/Objects/MultiLeaderStyle.cs @@ -173,7 +173,7 @@ public class MultiLeaderStyle : NonGraphicalObject /// /// [DxfCodeValue(92)] - public LineweightType LeaderLineWeight { get; set; } + public LineWeightType LeaderLineWeight { get; set; } // TODO It seems that this value indicates that for a new leader that is being created // with this landing i.e. a dogleg is enabled. diff --git a/src/ACadSharp/Tables/DimensionStyle.cs b/src/ACadSharp/Tables/DimensionStyle.cs index d990d726..084c6534 100644 --- a/src/ACadSharp/Tables/DimensionStyle.cs +++ b/src/ACadSharp/Tables/DimensionStyle.cs @@ -821,7 +821,7 @@ public double TextHeight /// (Multiply a value by 2540 to convert values from inches to hundredths of millimeters.) /// [DxfCodeValue(371)] - public LineweightType DimensionLineWeight { get; set; } = LineweightType.ByBlock; + public LineWeightType DimensionLineWeight { get; set; } = LineWeightType.ByBlock; /// /// Assigns lineweight to extension lines @@ -832,7 +832,7 @@ public double TextHeight /// (Multiply a value by 2540 to convert values from inches to hundredths of millimeters.) /// [DxfCodeValue(372)] - public LineweightType ExtensionLineWeight { get; set; } = LineweightType.ByBlock; + public LineWeightType ExtensionLineWeight { get; set; } = LineWeightType.ByBlock; /// /// Determines how dimension text and arrows are arranged when space is not sufficient diff --git a/src/ACadSharp/Tables/Layer.cs b/src/ACadSharp/Tables/Layer.cs index d7524de6..4159b8c0 100644 --- a/src/ACadSharp/Tables/Layer.cs +++ b/src/ACadSharp/Tables/Layer.cs @@ -95,7 +95,7 @@ public LineType LineType /// Specifies the lineweight of an individual object or the default lineweight for the drawing. /// [DxfCodeValue(370)] - public LineweightType LineWeight { get; set; } = LineweightType.Default; + public LineWeightType LineWeight { get; set; } = LineWeightType.Default; /// /// PlotStyleName object diff --git a/src/ACadSharp/Types/Lineweight.cs b/src/ACadSharp/Types/LineWeightType.cs similarity index 57% rename from src/ACadSharp/Types/Lineweight.cs rename to src/ACadSharp/Types/LineWeightType.cs index 6d589e79..89f96aee 100644 --- a/src/ACadSharp/Types/Lineweight.cs +++ b/src/ACadSharp/Types/LineWeightType.cs @@ -1,120 +1,120 @@ namespace ACadSharp { - public enum LineweightType : short + public enum LineWeightType : short { ByDIPs = -4, /// - /// Default lineweight. + /// Default line weight. /// Default = -3, /// - /// Lineweight defined by block. + /// Line weight defined by block. /// ByBlock = -2, /// - /// Lineweight defined by layer. + /// Line weight defined by layer. /// ByLayer = -1, /// - /// Lineweight value 0.00 mm (hairline). + /// Line weight value 0.00 mm (hairline). /// W0 = 0, /// - /// Lineweight value 0.05 mm. + /// Line weight value 0.05 mm. /// W5 = 5, /// - /// Lineweight value 0.09 mm. + /// Line weight value 0.09 mm. /// W9 = 9, /// - /// Lineweight value 0.13 mm. + /// Line weight value 0.13 mm. /// W13 = 13, /// - /// Lineweight value 0.15 mm. + /// Line weight value 0.15 mm. /// W15 = 15, /// - /// Lineweight value 0.18 mm. + /// Line weight value 0.18 mm. /// W18 = 18, /// - /// Lineweight value 0.20 mm. + /// Line weight value 0.20 mm. /// W20 = 20, /// - /// Lineweight value 0.25 mm. + /// Line weight value 0.25 mm. /// W25 = 25, /// - /// Lineweight value 0.30 mm. + /// Line weight value 0.30 mm. /// W30 = 30, /// - /// Lineweight value 0.35 mm. + /// Line weight value 0.35 mm. /// W35 = 35, /// - /// Lineweight value 0.40 mm. + /// Line weight value 0.40 mm. /// W40 = 40, /// - /// Lineweight value 0.50 mm. + /// Line weight value 0.50 mm. /// W50 = 50, /// - /// Lineweight value 0.53 mm. + /// Line weight value 0.53 mm. /// W53 = 53, /// - /// Lineweight value 0.60 mm. + /// Line weight value 0.60 mm. /// W60 = 60, /// - /// Lineweight value 0.70 mm. + /// Line weight value 0.70 mm. /// W70 = 70, /// - /// Lineweight value 0.80 mm. + /// Line weight value 0.80 mm. /// W80 = 80, /// - /// Lineweight value 0.90 mm. + /// Line weight value 0.90 mm. /// W90 = 90, /// - /// Lineweight value 1.00 mm. + /// Line weight value 1.00 mm. /// W100 = 100, /// - /// Lineweight value 1.06 mm. + /// Line weight value 1.06 mm. /// W106 = 106, /// - /// Lineweight value 1.20 mm. + /// Line weight value 1.20 mm. /// W120 = 120, /// - /// Lineweight value 1.40 mm. + /// Line weight value 1.40 mm. /// W140 = 140, /// - /// Lineweight value 1.58 mm. + /// Line weight value 1.58 mm. /// W158 = 158, /// - /// Lineweight value 2.00 mm. + /// Line weight value 2.00 mm. /// W200 = 200, /// - /// Lineweight value 2.11 mm. + /// Line weight value 2.11 mm. /// W211 = 211 } diff --git a/src/CSUtilities b/src/CSUtilities index bfd1ba4e..5119a7df 160000 --- a/src/CSUtilities +++ b/src/CSUtilities @@ -1 +1 @@ -Subproject commit bfd1ba4e2117d086850a1f01a81121fab08345d6 +Subproject commit 5119a7df2327113e2bb93294a747a07f2c69a336 From 71255811978f5b0145d2f2af55171a93a3664529 Mon Sep 17 00:00:00 2001 From: DomCR Date: Fri, 27 Sep 2024 07:04:37 +0200 Subject: [PATCH 06/16] spell --- src/ACadSharp/CadDocument.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ACadSharp/CadDocument.cs b/src/ACadSharp/CadDocument.cs index 0b519372..58337539 100644 --- a/src/ACadSharp/CadDocument.cs +++ b/src/ACadSharp/CadDocument.cs @@ -249,7 +249,7 @@ public void CreateDefaults() this.Header = new CadHeader(this); this.SummaryInfo = new CadSummaryInfo(); - //The order of the elements is rellevant for the handles assignation + //The order of the elements is relevant for the handles assignation //Initialize tables this.BlockRecords ??= new BlockRecordsTable(this); From 4fe520314fff0113637f7bb8e1abb19cd3bab0a1 Mon Sep 17 00:00:00 2001 From: DomCR Date: Fri, 27 Sep 2024 11:11:26 +0200 Subject: [PATCH 07/16] rollback viewport --- src/ACadSharp/Entities/ViewPort.cs | 8 ++++---- src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs | 2 +- .../IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs | 4 ++-- .../IO/DWG/DwgStreamWriters/DwgObjectWriter.Objects.cs | 2 +- .../IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs | 2 +- .../DXF/DxfStreamWriter/DxfSectionWriterBase.Entities.cs | 6 +++--- src/ACadSharp/IO/Templates/CadLayoutTemplate.cs | 4 ++-- src/ACadSharp/IO/Templates/CadViewportTemplate.cs | 6 +++--- src/ACadSharp/Objects/Layout.cs | 6 +++--- src/ACadSharp/Tables/BlockRecord.cs | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/ACadSharp/Entities/ViewPort.cs b/src/ACadSharp/Entities/ViewPort.cs index c50b1e8b..9194630a 100644 --- a/src/ACadSharp/Entities/ViewPort.cs +++ b/src/ACadSharp/Entities/ViewPort.cs @@ -7,7 +7,7 @@ namespace ACadSharp.Entities { /// - /// Represents a entity. + /// Represents a entity. /// /// /// Object name
@@ -15,7 +15,7 @@ namespace ACadSharp.Entities ///
[DxfName(DxfFileToken.EntityViewport)] [DxfSubClass(DxfSubclassMarker.Viewport)] - public class ViewPort : Entity + public class Viewport : Entity { /// /// Paper view Id, it indicates that the viewport acts as a paper size. @@ -63,7 +63,7 @@ public short Id if (this.Owner is BlockRecord record) { short id = 0; - foreach (ViewPort viewport in record.ViewPorts) + foreach (Viewport viewport in record.ViewPorts) { id += 1; if (viewport == this) @@ -324,7 +324,7 @@ public bool RepresentsPaper /// public override CadObject Clone() { - ViewPort clone = (ViewPort)base.Clone(); + Viewport clone = (Viewport)base.Clone(); clone.VisualStyle = (VisualStyle)this.VisualStyle?.Clone(); diff --git a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs index e567d654..2f495881 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs @@ -2213,7 +2213,7 @@ private CadTemplate readShape() private CadTemplate readViewport() { - ViewPort viewport = new ViewPort(); + Viewport viewport = new Viewport(); CadViewportTemplate template = new CadViewportTemplate(viewport); //Common Entity Data diff --git a/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs b/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs index 9a4d3bd0..f92c4c62 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs @@ -174,7 +174,7 @@ private void writeEntity(Entity entity) throw new NotImplementedException($"Vertex not implemented : {entity.GetType().FullName}"); } break; - case ViewPort viewport: + case Viewport viewport: this.writeViewport(viewport); break; case XLine xline: @@ -2264,7 +2264,7 @@ private void writeTolerance(Tolerance tolerance) this._writer.HandleReference(DwgReferenceType.HardPointer, tolerance.Style); } - private void writeViewport(ViewPort viewport) + private void writeViewport(Viewport viewport) { //Center 3BD 10 this._writer.Write3BitDouble(viewport.Center); diff --git a/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Objects.cs b/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Objects.cs index 5de3b61f..c36ac818 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Objects.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Objects.cs @@ -263,7 +263,7 @@ private void writeLayout(Layout layout) //R2004+: if (this.R2004Plus) { - foreach (Entities.ViewPort viewport in layout.Viewports) + foreach (Entities.Viewport viewport in layout.Viewports) { //Viewport handle(repeats Viewport count times) (soft pointer) this._writer.HandleReference(DwgReferenceType.SoftPointer, viewport); diff --git a/src/ACadSharp/IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs b/src/ACadSharp/IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs index 1801a55f..26030894 100644 --- a/src/ACadSharp/IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs +++ b/src/ACadSharp/IO/DXF/DxfStreamReader/DxfSectionReaderBase.cs @@ -189,7 +189,7 @@ protected CadEntityTemplate readEntity() case DxfFileToken.EntityVertex: return this.readEntityCodes(new CadVertexTemplate(), this.readVertex); case DxfFileToken.EntityViewport: - return this.readEntityCodes(new CadViewportTemplate(), this.readViewport); + return this.readEntityCodes(new CadViewportTemplate(), this.readViewport); case DxfFileToken.EntityShape: return this.readEntityCodes(new CadShapeTemplate(new Shape()), this.readShape); case DxfFileToken.EntitySpline: diff --git a/src/ACadSharp/IO/DXF/DxfStreamWriter/DxfSectionWriterBase.Entities.cs b/src/ACadSharp/IO/DXF/DxfStreamWriter/DxfSectionWriterBase.Entities.cs index dd74e768..c3c679d2 100644 --- a/src/ACadSharp/IO/DXF/DxfStreamWriter/DxfSectionWriterBase.Entities.cs +++ b/src/ACadSharp/IO/DXF/DxfStreamWriter/DxfSectionWriterBase.Entities.cs @@ -101,7 +101,7 @@ protected void writeEntity(T entity) case Vertex vertex: this.writeVertex(vertex); break; - case ViewPort viewport: + case Viewport viewport: this.writeViewport(viewport); break; case Wipeout wipeout: @@ -1152,9 +1152,9 @@ private void writeVertex(Vertex v) this._writer.Write(50, v.CurveTangent, map); } - private void writeViewport(ViewPort vp) + private void writeViewport(Viewport vp) { - DxfClassMap map = DxfClassMap.Create(); + DxfClassMap map = DxfClassMap.Create(); this._writer.Write(DxfCode.Subclass, DxfSubclassMarker.Viewport); diff --git a/src/ACadSharp/IO/Templates/CadLayoutTemplate.cs b/src/ACadSharp/IO/Templates/CadLayoutTemplate.cs index d559796d..75ed65bf 100644 --- a/src/ACadSharp/IO/Templates/CadLayoutTemplate.cs +++ b/src/ACadSharp/IO/Templates/CadLayoutTemplate.cs @@ -32,7 +32,7 @@ public override void Build(CadDocumentBuilder builder) this.CadObject.AssociatedBlock = record; } - if (builder.TryGetCadObject(this.ActiveViewportHandle, out ViewPort viewport)) + if (builder.TryGetCadObject(this.ActiveViewportHandle, out Viewport viewport)) { this.CadObject.Viewport = viewport; } @@ -49,7 +49,7 @@ public override void Build(CadDocumentBuilder builder) foreach (var handle in this.ViewportHandles) { - if (builder.TryGetCadObject(handle, out ViewPort vp)) + if (builder.TryGetCadObject(handle, out Viewport vp)) { //Is repeated, the viewports are already in the entities list in the BLOCK_RECORD // if(this.CadObject.AssociatedBlock.Viewports.Contains(vp)) diff --git a/src/ACadSharp/IO/Templates/CadViewportTemplate.cs b/src/ACadSharp/IO/Templates/CadViewportTemplate.cs index d316ffee..af13ce1a 100644 --- a/src/ACadSharp/IO/Templates/CadViewportTemplate.cs +++ b/src/ACadSharp/IO/Templates/CadViewportTemplate.cs @@ -20,15 +20,15 @@ internal class CadViewportTemplate : CadEntityTemplate public List FrozenLayerHandles { get; set; } = new List(); - public CadViewportTemplate() : base(new ViewPort()) { } + public CadViewportTemplate() : base(new Viewport()) { } - public CadViewportTemplate(ViewPort entity) : base(entity) { } + public CadViewportTemplate(Viewport entity) : base(entity) { } public override void Build(CadDocumentBuilder builder) { base.Build(builder); - ViewPort viewport = this.CadObject as ViewPort; + Viewport viewport = this.CadObject as Viewport; if (this.ViewportHeaderHandle.HasValue && this.ViewportHeaderHandle > 0) { diff --git a/src/ACadSharp/Objects/Layout.cs b/src/ACadSharp/Objects/Layout.cs index cf7d3420..43dfa209 100644 --- a/src/ACadSharp/Objects/Layout.cs +++ b/src/ACadSharp/Objects/Layout.cs @@ -143,7 +143,7 @@ internal set /// Viewport that was last active in this layout when the layout was current. /// [DxfCodeValue(DxfReferenceType.Handle, 331)] - public ViewPort Viewport + public Viewport Viewport { get { @@ -189,7 +189,7 @@ public bool IsPaperSpace //333 Shade plot ID - public IEnumerable Viewports + public IEnumerable Viewports { get { @@ -197,7 +197,7 @@ public IEnumerable Viewports } } - private ViewPort _lastViewport; + private Viewport _lastViewport; private BlockRecord _blockRecord; diff --git a/src/ACadSharp/Tables/BlockRecord.cs b/src/ACadSharp/Tables/BlockRecord.cs index c54bf13b..b527429e 100644 --- a/src/ACadSharp/Tables/BlockRecord.cs +++ b/src/ACadSharp/Tables/BlockRecord.cs @@ -146,11 +146,11 @@ public bool HasAttributes /// /// ViewPorts attached to this block /// - public IEnumerable ViewPorts + public IEnumerable ViewPorts { get { - return this.Entities.OfType(); + return this.Entities.OfType(); } } From 9bab82f99e5e8c86eb639a16dae362a7b2f972fd Mon Sep 17 00:00:00 2001 From: DomCR Date: Mon, 30 Sep 2024 11:16:36 +0200 Subject: [PATCH 08/16] submodule --- src/CSUtilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CSUtilities b/src/CSUtilities index 5119a7df..0a0a875c 160000 --- a/src/CSUtilities +++ b/src/CSUtilities @@ -1 +1 @@ -Subproject commit 5119a7df2327113e2bb93294a747a07f2c69a336 +Subproject commit 0a0a875c18c70a82ca5d44e26440991d89100647 From 77d3323bbd2222434d320eafaa999999a65cd794 Mon Sep 17 00:00:00 2001 From: DomCR Date: Mon, 30 Sep 2024 11:58:26 +0200 Subject: [PATCH 09/16] viewport spelling --- src/ACadSharp/Entities/ViewPort.cs | 2 +- src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs | 2 +- .../IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ACadSharp/Entities/ViewPort.cs b/src/ACadSharp/Entities/ViewPort.cs index 9194630a..a1248e58 100644 --- a/src/ACadSharp/Entities/ViewPort.cs +++ b/src/ACadSharp/Entities/ViewPort.cs @@ -290,7 +290,7 @@ public short Id /// View contrast ///
[DxfCodeValue(142)] - public double Constrast { get; set; } + public double Contrast { get; set; } /// /// Ambient light color.Write only if not black color. diff --git a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs index 2f495881..f4323084 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs @@ -2305,7 +2305,7 @@ private CadTemplate readViewport() //Brightness BD 141 viewport.Brightness = this._objectReader.ReadBitDouble(); //Contrast BD 142 - viewport.Constrast = this._objectReader.ReadBitDouble(); + viewport.Contrast = this._objectReader.ReadBitDouble(); //Ambient light color CMC 63 viewport.AmbientLightColor = this._objectReader.ReadCmColor(); } diff --git a/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs b/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs index f92c4c62..fde12f5b 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Entities.cs @@ -2355,7 +2355,7 @@ private void writeViewport(Viewport viewport) //Brightness BD 141 this._writer.WriteBitDouble(viewport.Brightness); //Contrast BD 142 - this._writer.WriteBitDouble(viewport.Constrast); + this._writer.WriteBitDouble(viewport.Contrast); //Ambient light color CMC 63 this._writer.WriteCmColor(viewport.AmbientLightColor); } From a608839718b3c9f2972655d79c7a5055c98a9bed Mon Sep 17 00:00:00 2001 From: DomCR Date: Tue, 1 Oct 2024 11:25:59 +0200 Subject: [PATCH 10/16] draw arc --- src/ACadSharp/Entities/Arc.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ACadSharp/Entities/Arc.cs b/src/ACadSharp/Entities/Arc.cs index dc7cbba2..b6d723ac 100644 --- a/src/ACadSharp/Entities/Arc.cs +++ b/src/ACadSharp/Entities/Arc.cs @@ -121,7 +121,7 @@ public List PolygonalVertexes(int precision) cosine = MathUtils.IsZero(cosine) ? 0 : cosine; sine = MathUtils.IsZero(sine) ? 0 : sine; - ocsVertexes.Add(new XY(cosine, sine)); + ocsVertexes.Add(new XY(cosine + this.Center.X, sine + this.Center.Y)); } return ocsVertexes; From 52b9406e4b39fc795bc3b6966ddc997fd9e846e3 Mon Sep 17 00:00:00 2001 From: DomCR Date: Tue, 1 Oct 2024 12:01:03 +0200 Subject: [PATCH 11/16] rollback LineweightType spelling --- src/ACadSharp/CadUtils.cs | 68 +++++++++---------- src/ACadSharp/Entities/Entity.cs | 2 +- src/ACadSharp/Entities/IEntity.cs | 2 +- src/ACadSharp/Entities/MultiLeader.cs | 2 +- src/ACadSharp/Header/CadHeader.cs | 6 +- .../DWG/DwgStreamReaders/DwgHeaderReader.cs | 6 +- .../DWG/DwgStreamReaders/DwgObjectReader.cs | 10 +-- .../DxfStreamReader/DxfTablesSectionReader.cs | 4 +- .../Objects/MultiLeaderAnnotContextClasses.cs | 2 +- src/ACadSharp/Objects/MultiLeaderStyle.cs | 2 +- src/ACadSharp/Tables/DimensionStyle.cs | 4 +- src/ACadSharp/Tables/Layer.cs | 2 +- src/ACadSharp/Types/LineWeightType.cs | 2 +- 13 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/ACadSharp/CadUtils.cs b/src/ACadSharp/CadUtils.cs index 83ae5b4d..7db69351 100644 --- a/src/ACadSharp/CadUtils.cs +++ b/src/ACadSharp/CadUtils.cs @@ -80,32 +80,32 @@ internal static class CadUtils {"iso8859-15",CodePage.Iso885915}, }; - private static readonly LineWeightType[] _indexedValue = new LineWeightType[] + private static readonly LineweightType[] _indexedValue = new LineweightType[] { - LineWeightType.W0, - LineWeightType.W5, - LineWeightType.W9, - LineWeightType.W13, - LineWeightType.W15, - LineWeightType.W18, - LineWeightType.W20, - LineWeightType.W25, - LineWeightType.W30, - LineWeightType.W35, - LineWeightType.W40, - LineWeightType.W50, - LineWeightType.W53, - LineWeightType.W60, - LineWeightType.W70, - LineWeightType.W80, - LineWeightType.W90, - LineWeightType.W100, - LineWeightType.W106, - LineWeightType.W120, - LineWeightType.W140, - LineWeightType.W158, - LineWeightType.W200, - LineWeightType.W211 + LineweightType.W0, + LineweightType.W5, + LineweightType.W9, + LineweightType.W13, + LineweightType.W15, + LineweightType.W18, + LineweightType.W20, + LineweightType.W25, + LineweightType.W30, + LineweightType.W35, + LineweightType.W40, + LineweightType.W50, + LineweightType.W53, + LineweightType.W60, + LineweightType.W70, + LineweightType.W80, + LineweightType.W90, + LineweightType.W100, + LineweightType.W106, + LineweightType.W120, + LineweightType.W140, + LineweightType.W158, + LineweightType.W200, + LineweightType.W211 }; private static readonly CodePage[] _pageCodes = new CodePage[] @@ -157,38 +157,38 @@ internal static class CadUtils CodePage.Windows1258 }; - public static LineWeightType ToValue(byte b) + public static LineweightType ToValue(byte b) { switch (b) { case 28: case 29: - return LineWeightType.ByLayer; + return LineweightType.ByLayer; case 30: - return LineWeightType.ByBlock; + return LineweightType.ByBlock; case 31: - return LineWeightType.Default; + return LineweightType.Default; default: if (b < 0 || b >= _indexedValue.Length) { - return LineWeightType.Default; + return LineweightType.Default; } return _indexedValue[b]; } } - public static byte ToIndex(LineWeightType value) + public static byte ToIndex(LineweightType value) { byte result = 0; switch (value) { - case LineWeightType.Default: + case LineweightType.Default: result = 31; break; - case LineWeightType.ByBlock: + case LineweightType.ByBlock: result = 30; break; - case LineWeightType.ByLayer: + case LineweightType.ByLayer: result = 29; break; default: diff --git a/src/ACadSharp/Entities/Entity.cs b/src/ACadSharp/Entities/Entity.cs index 3f6b396c..0e1d9f2c 100644 --- a/src/ACadSharp/Entities/Entity.cs +++ b/src/ACadSharp/Entities/Entity.cs @@ -44,7 +44,7 @@ public Layer Layer /// [DxfCodeValue(370)] - public LineWeightType LineWeight { get; set; } = LineWeightType.ByLayer; + public LineweightType LineWeight { get; set; } = LineweightType.ByLayer; /// [DxfCodeValue(48)] diff --git a/src/ACadSharp/Entities/IEntity.cs b/src/ACadSharp/Entities/IEntity.cs index e15f4b44..70b9a812 100644 --- a/src/ACadSharp/Entities/IEntity.cs +++ b/src/ACadSharp/Entities/IEntity.cs @@ -23,7 +23,7 @@ public interface IEntity : IHandledCadObject /// /// Specifies the lineweight of an individual object or the default lineweight for the drawing. /// - LineWeightType LineWeight { get; set; } + LineweightType LineWeight { get; set; } /// /// Linetype scale for this entity. diff --git a/src/ACadSharp/Entities/MultiLeader.cs b/src/ACadSharp/Entities/MultiLeader.cs index 83163f6b..71daafa9 100644 --- a/src/ACadSharp/Entities/MultiLeader.cs +++ b/src/ACadSharp/Entities/MultiLeader.cs @@ -175,7 +175,7 @@ public object Clone() /// property. /// [DxfCodeValue(171)] - public LineWeightType LeaderLineWeight { get; set; } + public LineweightType LeaderLineWeight { get; set; } /// /// Gets or sets a value indicating whether landing is enabled. diff --git a/src/ACadSharp/Header/CadHeader.cs b/src/ACadSharp/Header/CadHeader.cs index a99f8ec4..3f5f6583 100644 --- a/src/ACadSharp/Header/CadHeader.cs +++ b/src/ACadSharp/Header/CadHeader.cs @@ -1327,7 +1327,7 @@ public XYZ ModelSpaceYAxis /// System variable CELWEIGHT /// [CadSystemVariable("$CELWEIGHT", 370)] - public LineWeightType CurrentEntityLineWeight { get; set; } = LineWeightType.ByLayer; + public LineweightType CurrentEntityLineWeight { get; set; } = LineweightType.ByLayer; /// /// Lineweight endcaps setting for new objects @@ -2420,7 +2420,7 @@ public double DimensionTextVerticalPosition /// System variable DIMLWD /// [CadSystemVariable("$DIMLWD", 70)] - public LineWeightType DimensionLineWeight + public LineweightType DimensionLineWeight { get { return this.DimensionStyleOverrides.DimensionLineWeight; } set @@ -2436,7 +2436,7 @@ public LineWeightType DimensionLineWeight /// System variable DIMLWE /// [CadSystemVariable("$DIMLWE", 70)] - public LineWeightType ExtensionLineWeight + public LineweightType ExtensionLineWeight { get { return this.DimensionStyleOverrides.ExtensionLineWeight; } set diff --git a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgHeaderReader.cs b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgHeaderReader.cs index e441645a..30571e41 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgHeaderReader.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgHeaderReader.cs @@ -788,9 +788,9 @@ public void Read(int acadMaintenanceVersion, out DwgHeaderHandlesCollection obje if (R2000Plus) { //BS: DIMLWD - _header.DimensionLineWeight = (LineWeightType)_reader.ReadBitShort(); + _header.DimensionLineWeight = (LineweightType)_reader.ReadBitShort(); //BS : DIMLWE - _header.ExtensionLineWeight = (LineWeightType)_reader.ReadBitShort(); + _header.ExtensionLineWeight = (LineweightType)_reader.ReadBitShort(); } //H: BLOCK CONTROL OBJECT(hard owner) @@ -876,7 +876,7 @@ public void Read(int acadMaintenanceVersion, out DwgHeaderHandlesCollection obje //BL: Flags: int flags = _reader.ReadBitLong(); //CELWEIGHT Flags & 0x001F - _header.CurrentEntityLineWeight = (LineWeightType)(flags & 0x1F); + _header.CurrentEntityLineWeight = (LineweightType)(flags & 0x1F); //ENDCAPS Flags & 0x0060 _header.EndCaps = (short)(flags & 0x60); //JOINSTYLE Flags & 0x0180 diff --git a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs index f4323084..7d98092a 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs @@ -2895,7 +2895,7 @@ private CadTemplate readMultiLeader() template.LeaderLineTypeHandle = this.handleReference(); //BL 171 LeaderLine Weight - mLeader.LeaderLineWeight = (LineWeightType)this._objectReader.ReadBitLong(); + mLeader.LeaderLineWeight = (LineweightType)this._objectReader.ReadBitLong(); //B 290 Enable Landing mLeader.EnableLanding = this._objectReader.ReadBit(); //B 291 Enable Dogleg @@ -3262,7 +3262,7 @@ private LeaderLine readLeaderLine(CadMLeaderTemplate template) // H 340 Line type handle(hard pointer) leaderLineSubTemplate.LineTypeHandle = this.handleReference(); // BL 171 Line weight - leaderLine.LineWeight = (LineWeightType)this._objectReader.ReadBitLong(); + leaderLine.LineWeight = (LineweightType)this._objectReader.ReadBitLong(); // BD 40 Arrow size leaderLine.ArrowheadSize = this._objectReader.ReadBitDouble(); // H 341 Arrow symbol handle(hard pointer) @@ -3308,7 +3308,7 @@ private CadTemplate readMultiLeaderStyle() // H 340 Leader line type handle (hard pointer) template.LeaderLineTypeHandle = this.handleReference(); // BL 92 Leader line weight - mLeaderStyle.LeaderLineWeight = (LineWeightType)this._objectReader.ReadBitLong(); + mLeaderStyle.LeaderLineWeight = (LineweightType)this._objectReader.ReadBitLong(); // B 290 Is landing enabled? mLeaderStyle.EnableLanding = this._objectReader.ReadBit(); // BD 42 Landing gap @@ -4555,9 +4555,9 @@ private CadTemplate readDimStyle() if (this.R2000Plus) { //DIMLWD BS 371 - dimStyle.DimensionLineWeight = (LineWeightType)this._objectReader.ReadBitShort(); + dimStyle.DimensionLineWeight = (LineweightType)this._objectReader.ReadBitShort(); //DIMLWE BS 372 - dimStyle.ExtensionLineWeight = (LineWeightType)this._objectReader.ReadBitShort(); + dimStyle.ExtensionLineWeight = (LineweightType)this._objectReader.ReadBitShort(); } //Common: diff --git a/src/ACadSharp/IO/DXF/DxfStreamReader/DxfTablesSectionReader.cs b/src/ACadSharp/IO/DXF/DxfStreamReader/DxfTablesSectionReader.cs index 344f162b..ec321f9a 100644 --- a/src/ACadSharp/IO/DXF/DxfStreamReader/DxfTablesSectionReader.cs +++ b/src/ACadSharp/IO/DXF/DxfStreamReader/DxfTablesSectionReader.cs @@ -530,10 +530,10 @@ private bool readDimensionStyle(CadTableEntryTemplate template, tmp.DIMBLK2 = this._reader.ValueAsHandle; return true; case 371: - template.CadObject.DimensionLineWeight = (LineWeightType)this._reader.ValueAsShort; + template.CadObject.DimensionLineWeight = (LineweightType)this._reader.ValueAsShort; return true; case 372: - template.CadObject.ExtensionLineWeight = (LineWeightType)this._reader.ValueAsShort; + template.CadObject.ExtensionLineWeight = (LineweightType)this._reader.ValueAsShort; return true; default: return false; diff --git a/src/ACadSharp/Objects/MultiLeaderAnnotContextClasses.cs b/src/ACadSharp/Objects/MultiLeaderAnnotContextClasses.cs index 82a2354c..edbbb3f8 100644 --- a/src/ACadSharp/Objects/MultiLeaderAnnotContextClasses.cs +++ b/src/ACadSharp/Objects/MultiLeaderAnnotContextClasses.cs @@ -189,7 +189,7 @@ public LeaderLine() { } /// Line weight /// [DxfCodeValue(171)] - public LineWeightType LineWeight { get; set; } + public LineweightType LineWeight { get; set; } /// /// Arrowhead size diff --git a/src/ACadSharp/Objects/MultiLeaderStyle.cs b/src/ACadSharp/Objects/MultiLeaderStyle.cs index f347afa3..326ce52b 100644 --- a/src/ACadSharp/Objects/MultiLeaderStyle.cs +++ b/src/ACadSharp/Objects/MultiLeaderStyle.cs @@ -173,7 +173,7 @@ public class MultiLeaderStyle : NonGraphicalObject /// /// [DxfCodeValue(92)] - public LineWeightType LeaderLineWeight { get; set; } + public LineweightType LeaderLineWeight { get; set; } // TODO It seems that this value indicates that for a new leader that is being created // with this landing i.e. a dogleg is enabled. diff --git a/src/ACadSharp/Tables/DimensionStyle.cs b/src/ACadSharp/Tables/DimensionStyle.cs index 7dfd5e1b..f71ad19f 100644 --- a/src/ACadSharp/Tables/DimensionStyle.cs +++ b/src/ACadSharp/Tables/DimensionStyle.cs @@ -821,7 +821,7 @@ public double TextHeight /// (Multiply a value by 2540 to convert values from inches to hundredths of millimeters.) /// [DxfCodeValue(371)] - public LineWeightType DimensionLineWeight { get; set; } = LineWeightType.ByBlock; + public LineweightType DimensionLineWeight { get; set; } = LineweightType.ByBlock; /// /// Assigns line weight to extension lines @@ -832,7 +832,7 @@ public double TextHeight /// (Multiply a value by 2540 to convert values from inches to hundredths of millimeters.) /// [DxfCodeValue(372)] - public LineWeightType ExtensionLineWeight { get; set; } = LineWeightType.ByBlock; + public LineweightType ExtensionLineWeight { get; set; } = LineweightType.ByBlock; /// /// Determines how dimension text and arrows are arranged when space is not sufficient diff --git a/src/ACadSharp/Tables/Layer.cs b/src/ACadSharp/Tables/Layer.cs index adde03e4..4cb93483 100644 --- a/src/ACadSharp/Tables/Layer.cs +++ b/src/ACadSharp/Tables/Layer.cs @@ -95,7 +95,7 @@ public LineType LineType /// Specifies the lineweight of an individual object or the default lineweight for the drawing. /// [DxfCodeValue(370)] - public LineWeightType LineWeight { get; set; } = LineWeightType.Default; + public LineweightType LineWeight { get; set; } = LineweightType.Default; /// /// PlotStyleName object diff --git a/src/ACadSharp/Types/LineWeightType.cs b/src/ACadSharp/Types/LineWeightType.cs index 89f96aee..938f8141 100644 --- a/src/ACadSharp/Types/LineWeightType.cs +++ b/src/ACadSharp/Types/LineWeightType.cs @@ -1,6 +1,6 @@ namespace ACadSharp { - public enum LineWeightType : short + public enum LineweightType : short { ByDIPs = -4, From f9d36c1856a43e0171f141e1915c25d4c8c47db8 Mon Sep 17 00:00:00 2001 From: DomCR Date: Tue, 1 Oct 2024 13:01:20 +0200 Subject: [PATCH 12/16] Viewports spelling rollback --- src/ACadSharp/Entities/Viewport.cs | 2 +- src/ACadSharp/Objects/Layout.cs | 2 +- src/ACadSharp/Tables/BlockRecord.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ACadSharp/Entities/Viewport.cs b/src/ACadSharp/Entities/Viewport.cs index 1fd23248..bf408945 100644 --- a/src/ACadSharp/Entities/Viewport.cs +++ b/src/ACadSharp/Entities/Viewport.cs @@ -63,7 +63,7 @@ public short Id if (this.Owner is BlockRecord record) { short id = 0; - foreach (Viewport viewport in record.ViewPorts) + foreach (Viewport viewport in record.Viewports) { id += 1; if (viewport == this) diff --git a/src/ACadSharp/Objects/Layout.cs b/src/ACadSharp/Objects/Layout.cs index 43dfa209..c80b5c95 100644 --- a/src/ACadSharp/Objects/Layout.cs +++ b/src/ACadSharp/Objects/Layout.cs @@ -193,7 +193,7 @@ public IEnumerable Viewports { get { - return this.AssociatedBlock?.ViewPorts; + return this.AssociatedBlock?.Viewports; } } diff --git a/src/ACadSharp/Tables/BlockRecord.cs b/src/ACadSharp/Tables/BlockRecord.cs index b527429e..7e1eb0fd 100644 --- a/src/ACadSharp/Tables/BlockRecord.cs +++ b/src/ACadSharp/Tables/BlockRecord.cs @@ -146,7 +146,7 @@ public bool HasAttributes /// /// ViewPorts attached to this block /// - public IEnumerable ViewPorts + public IEnumerable Viewports { get { From 7c9b287ba3d139e607cbf060f5cc746e04009db4 Mon Sep 17 00:00:00 2001 From: DomCR Date: Wed, 16 Oct 2024 07:42:18 +0200 Subject: [PATCH 13/16] submodule --- src/CSUtilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CSUtilities b/src/CSUtilities index 2e0fbe7f..0a0a875c 160000 --- a/src/CSUtilities +++ b/src/CSUtilities @@ -1 +1 @@ -Subproject commit 2e0fbe7f2305037ec10e358891e80ffd7fdfdc2d +Subproject commit 0a0a875c18c70a82ca5d44e26440991d89100647 From e4d9a7c6e5930206c87f937aa1d8a2dc44af10d8 Mon Sep 17 00:00:00 2001 From: DomCR Date: Thu, 17 Oct 2024 08:53:59 +0200 Subject: [PATCH 14/16] submodule --- src/CSUtilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CSUtilities b/src/CSUtilities index 0a0a875c..03f926cb 160000 --- a/src/CSUtilities +++ b/src/CSUtilities @@ -1 +1 @@ -Subproject commit 0a0a875c18c70a82ca5d44e26440991d89100647 +Subproject commit 03f926cb78953c7f49f79a799828f1f1f2ad4ea5 From 349c7001ebb4f17cc77f99fcf1fef746f098d4d8 Mon Sep 17 00:00:00 2001 From: DomCR Date: Tue, 22 Oct 2024 11:43:20 +0200 Subject: [PATCH 15/16] scale factor for viewport --- src/ACadSharp/Entities/Viewport.cs | 4 +++- src/ACadSharp/Objects/Scale.cs | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/ACadSharp/Entities/Viewport.cs b/src/ACadSharp/Entities/Viewport.cs index 4fabd5bf..09d82334 100644 --- a/src/ACadSharp/Entities/Viewport.cs +++ b/src/ACadSharp/Entities/Viewport.cs @@ -351,7 +351,7 @@ public Scale Scale } } - private Scale _scale; + public double ScaleFactor => 1 / (this.ViewHeight / this.Height); public bool RepresentsPaper { @@ -361,6 +361,8 @@ public bool RepresentsPaper } } + private Scale _scale; + /// public override CadObject Clone() { diff --git a/src/ACadSharp/Objects/Scale.cs b/src/ACadSharp/Objects/Scale.cs index b6701041..cf45894b 100644 --- a/src/ACadSharp/Objects/Scale.cs +++ b/src/ACadSharp/Objects/Scale.cs @@ -1,4 +1,5 @@ using ACadSharp.Attributes; +using CSMath; namespace ACadSharp.Objects { @@ -13,6 +14,8 @@ namespace ACadSharp.Objects [DxfSubClass(DxfSubclassMarker.Scale)] public class Scale : NonGraphicalObject { + public static Scale Default { get { return new Scale { Name = "1:1", PaperUnits = 1.0, DrawingUnits = 1.0, IsUnitScale = true }; } } + /// public override ObjectType ObjectType { get { return ObjectType.UNLISTED; } } @@ -56,10 +59,30 @@ public override string Name [DxfCodeValue(290)] public bool IsUnitScale { get; set; } + public double ScaleFactor => this.PaperUnits / this.DrawingUnits; + public Scale() { } public Scale(string name) : base(name) { } + + public double ApplyTo(double value) + { + return value * ScaleFactor; + } + + public T ApplyTo(T value) + where T : IVector, new() + { + T result = new(); + + for (int i = 0; i < value.Dimension; i++) + { + result[i] = ApplyTo(value[i]); + } + + return result; + } } } From 70f6c527a5b769f6ec8c848985ed14f181793b1b Mon Sep 17 00:00:00 2001 From: DomCR Date: Thu, 24 Oct 2024 13:36:39 +0200 Subject: [PATCH 16/16] docs --- src/ACadSharp/Entities/Viewport.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/ACadSharp/Entities/Viewport.cs b/src/ACadSharp/Entities/Viewport.cs index 09d82334..2c27ad3a 100644 --- a/src/ACadSharp/Entities/Viewport.cs +++ b/src/ACadSharp/Entities/Viewport.cs @@ -329,7 +329,7 @@ public double ViewWidth //Soft pointer reference to viewport object (for layer VP property override) /// - /// + /// Scale assigned for this viewport. /// public Scale Scale { @@ -351,8 +351,20 @@ public Scale Scale } } + /// + /// Scale factor applied in this viewport. + /// + /// + /// Represents the scale applied to all the entities in the model when are visualized in the paper. + /// public double ScaleFactor => 1 / (this.ViewHeight / this.Height); + /// + /// Flag that set for those viewports that represent the paper in the view. + /// + /// + /// A paper viewport is only for boundaries only, does not visualize anything. + /// public bool RepresentsPaper { get @@ -381,7 +393,10 @@ public override BoundingBox GetBoundingBox() return new BoundingBox(min, max); } - /// + /// + /// Gets the bounding box of this viewport in the model space. + /// + /// public BoundingBox GetModelBoundingBox() { XYZ min = new XYZ(this.ViewCenter.X - this.ViewWidth / 2, this.ViewCenter.Y - this.ViewHeight / 2, 0);