Class Layouts
Represents a collection of layouts.
Inherited Members
Namespace: netDxf.Collections
Assembly: CADability.dll
Syntax
public sealed class Layouts : TableObjects<Layout>, IEnumerable<Layout>, IEnumerable
Remarks
AutoCad limits the number of layouts to 256, but at the same time it allows to import DXF files with more than that, for this reason the max capacity has been set to short.MaxValue. The maximum number of layouts is also limited by the number of blocks, due to that for each layout a block record must exist in the blocks collection.
Methods
| Improve this Doc View SourceGetReferences(Layout)
Gets the DxfObject referenced by a T.
Declaration
public List<DxfObject> GetReferences(Layout item)
Parameters
| Type | Name | Description |
|---|---|---|
| Layout | item | Table object. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<DxfObject> | The list of DxfObjects that reference the specified table object. |
Remarks
If there is no table object with the specified name in the list the method an empty list.
The Groups collection method GetReferences will always return an empty list since there are no DxfObjects that references them.
GetReferences(String)
Gets the DxfObject referenced by a T.
Declaration
public List<DxfObject> GetReferences(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Table object name. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<DxfObject> | The list of DxfObjects that reference the specified table object. |
Remarks
If there is no table object with the specified name in the list the method an empty list.
The Groups collection method GetReferences will always return an empty list since there are no DxfObjects that references them.
Remove(Layout)
Deletes a layout and removes the layout entities from the document.
Declaration
public override bool Remove(Layout item)
Parameters
| Type | Name | Description |
|---|---|---|
| Layout | item | Layout to remove from the document. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the layout has been successfully removed, or false otherwise. |
Overrides
Remarks
Reserved layouts or any other referenced by objects cannot be removed.
Remove(String)
Deletes a layout and removes the layout entities from the document.
Declaration
public override bool Remove(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Layout name to remove from the document. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the layout has been successfully removed, or false otherwise. |
Overrides
Remarks
The ModelSpace layout cannot be removed. If all PaperSpace layouts have been removed a default PaperSpace will be created since it is required by the DXF implementation.
When a Layout is deleted all entities that has been added to it will also be removed.
Removing a Layout will rebuild the PaperSpace block names, to follow the naming rule: Paper_Space, Paper_Space0, Paper_Space1, ...