Class Linetypes
Represents a collection of line types.
Inherited Members
Namespace: netDxf.Collections
Assembly: CADability.dll
Syntax
public sealed class Linetypes : TableObjects<Linetype>, IEnumerable<Linetype>, IEnumerable
Methods
| Improve this Doc View SourceAddFromFile(String, Boolean)
Adds all linetypes to the list from the definition in a LIN file.
Declaration
public void AddFromFile(string file, bool reload)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | File where the definition is located. |
| System.Boolean | reload | Specifies if the linetype definitions of the file will overwrite the existing ones, in case another with the same name exists in the file. |
Remarks
If the file is not found in the specified folder, it will try to find them in the list of supported folders defined in the DxfDocument.
Any text style or shape present in the linetype definition must be previously defined in the DxfDocument, if not an exception will be generated.
AddFromFile(String, String, Boolean)
Adds a linetype to the list from the definition in a LIN file.
Declaration
public bool AddFromFile(string file, string linetypeName, bool reload)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | File where the definition is located. |
| System.String | linetypeName | Name of the line type definition to read (ignore case). |
| System.Boolean | reload | Specifies if the linetype definition of the file will overwrite the existing one, in case another with the same name exists in the file. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the linetype has been added from the linetype definitions LIN file; false otherwise. It will return false if the linetype is present in the file and the reload argument is false. |
Remarks
If the file is not found in the specified folder, it will try to find them in the list of supported folders defined in the DxfDocument.
Any text style or shape present in the linetype definition must be previously defined in the DxfDocument, if not an exception will be generated.
NamesFromFile(String)
Gets the list of linetype names defined in a LIN file.
Declaration
public List<string> NamesFromFile(string file)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | Linetype definitions file. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | List of linetype names contained in the specified LIN file. |
Remarks
If the file is not found in the specified folder, it will try to find them in the list of supported folders defined in the DxfDocument.
Remove(Linetype)
Removes a line type.
Declaration
public override bool Remove(Linetype item)
Parameters
| Type | Name | Description |
|---|---|---|
| Linetype | item | Linetype to remove from the document. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the line type has been successfully removed, or false otherwise. |
Overrides
Remarks
Reserved line types or any other referenced by objects cannot be removed.
Remove(String)
Removes a line type.
Declaration
public override bool Remove(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Linetype name to remove from the document. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the line type has been successfully removed, or false otherwise. |
Overrides
Remarks
Reserved line types or any other referenced by objects cannot be removed.
Save(String, Boolean)
Saves all linetype definitions to a LIN file.
Declaration
public void Save(string file, bool overwrite)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | File where the linetype definitions will be saved. |
| System.Boolean | overwrite | Defines if the file will be overwritten in case exits another one. |
Remarks
Only non reserved linetypes will be saved, therefore Continuous, ByLayer, and ByBlock will be excluded.