diff --git a/README.md b/README.md index 390e3d58..0ad3efe5 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ ACadSharp allows to read or create CAD files using .Net and also extract or modi - Extract/Modify the geometric information from the different [entities](https://help.autodesk.com/view/OARX/2021/ENU/?guid=GUID-7D07C886-FD1D-4A0C-A7AB-B4D21F18E484) in the model - Control over the table elements like Blocks, Layers and Styles, allows you to read, create or modify the different tables +For pdf export check :construction: [ACadSharp.Pdf](https://github.com/DomCR/ACadSharp.Pdf) :construction:. + #### Compatible Dwg/Dxf versions: | | DxfReader | DxfWriter | DwgReader | DwgWriter | diff --git a/src/ACadSharp/Objects/Layout.cs b/src/ACadSharp/Objects/Layout.cs index 032a17d2..c80b5c95 100644 --- a/src/ACadSharp/Objects/Layout.cs +++ b/src/ACadSharp/Objects/Layout.cs @@ -2,17 +2,18 @@ using ACadSharp.Entities; using ACadSharp.Tables; using CSMath; +using System; using System.Collections.Generic; using System.Linq; namespace ACadSharp.Objects { /// - /// Represents a object + /// Represents a object. /// /// - /// Object name
- /// Dxf class name + /// Object name .
+ /// Dxf class name . ///
[DxfName(DxfFileToken.ObjectLayout)] [DxfSubClass(DxfSubclassMarker.Layout)] @@ -32,7 +33,7 @@ public class Layout : PlotSettings public override string SubclassMarker => DxfSubclassMarker.Layout; /// - /// Layout name + /// Layout name. /// [DxfCodeValue(1)] public override string Name @@ -48,79 +49,79 @@ public override string Name } /// - /// Layout flags + /// Layout flags. /// [DxfCodeValue(70)] public LayoutFlags LayoutFlags { get; set; } /// - /// Tab order.This number is an ordinal indicating this layout's ordering in the tab control that is attached to the drawing window. Note that the “Model” tab always appears as the first tab regardless of its tab order + /// Tab order. This number is an ordinal indicating this layout's ordering in the tab control that is attached to the drawing window. Note that the “Model” tab always appears as the first tab regardless of its tab order. /// [DxfCodeValue(71)] public int TabOrder { get; set; } /// - /// Minimum limits for this layout (defined by LIMMIN while this layout is current) + /// Minimum limits for this layout (defined by LIMMIN while this layout is current). /// [DxfCodeValue(10, 20)] public XY MinLimits { get; set; } = new XY(-20.0, -7.5); /// - /// Maximum limits for this layout(defined by LIMMAX while this layout is current) + /// Maximum limits for this layout(defined by LIMMAX while this layout is current). /// [DxfCodeValue(11, 21)] public XY MaxLimits { get; set; } = new XY(277.0, 202.5); /// - /// Insertion base point for this layout(defined by INSBASE while this layout is current) + /// Insertion base point for this layout(defined by INSBASE while this layout is current). /// [DxfCodeValue(12, 22, 32)] public XYZ InsertionBasePoint { get; set; } /// - /// Minimum extents for this layout(defined by EXTMIN while this layout is current) + /// Minimum extents for this layout(defined by EXTMIN while this layout is current). /// [DxfCodeValue(14, 24, 34)] public XYZ MinExtents { get; set; } = new XYZ(25.7, 19.5, 0.0); /// - /// Maximum extents for this layout(defined by EXTMAX while this layout is current) + /// Maximum extents for this layout(defined by EXTMAX while this layout is current). /// [DxfCodeValue(15, 25, 35)] public XYZ MaxExtents { get; set; } = new XYZ(231.3, 175.5, 0.0); /// - /// Layout elevation + /// Layout elevation. /// [DxfCodeValue(146)] public double Elevation { get; set; } /// - /// UCS origin + /// UCS origin. /// [DxfCodeValue(13, 23, 33)] public XYZ Origin { get; set; } = XYZ.Zero; /// - /// UCS X-axis + /// UCS X-axis. /// [DxfCodeValue(16, 26, 36)] public XYZ XAxis { get; set; } = XYZ.AxisX; /// - /// UCS Y-axis + /// UCS Y-axis. /// [DxfCodeValue(17, 27, 37)] public XYZ YAxis { get; set; } = XYZ.AxisY; /// - /// Orthographic type of UCS + /// Orthographic type of UCS. /// [DxfCodeValue(76)] public OrthographicType UcsOrthographicType { get; set; } /// - /// The associated paper space block table record + /// The associated paper space block table record. /// [DxfCodeValue(DxfReferenceType.Handle, 330)] public BlockRecord AssociatedBlock @@ -139,7 +140,7 @@ internal set } /// - /// Viewport that was last active in this layout when the layout was current + /// Viewport that was last active in this layout when the layout was current. /// [DxfCodeValue(DxfReferenceType.Handle, 331)] public Viewport Viewport @@ -158,23 +159,34 @@ internal set } /// - /// UCS Table Record if UCS is a named UCS + /// UCS Table Record if UCS is a named UCS. /// /// - /// If not present, then UCS is unnamed + /// If not present, then UCS is unnamed. /// [DxfCodeValue(DxfReferenceType.Handle, 345)] public UCS UCS { get; set; } /// - /// UCSTableRecord of base UCS if UCS is orthographic ( is non-zero) + /// UCSTableRecord of base UCS if UCS is orthographic ( is non-zero). /// /// - /// If not present and is non-zero, then base UCS is taken to be WORLD + /// If not present and is non-zero, then base UCS is taken to be WORLD. /// [DxfCodeValue(DxfReferenceType.Handle, 346)] public UCS BaseUCS { get; set; } + /// + /// If true, the layout is a paper space. + /// + public bool IsPaperSpace + { + get + { + return !this.Name.Equals(ModelLayoutName, StringComparison.InvariantCultureIgnoreCase); + } + } + //333 Shade plot ID public IEnumerable Viewports @@ -201,6 +213,7 @@ public Layout(string name, string blockName) : base() this._blockRecord = new BlockRecord(blockName); } + /// public override CadObject Clone() { Layout clone = (Layout)base.Clone();