Class HeaderVariables
Represents the header variables of a DXF document.
Inheritance
Inherited Members
Namespace: netDxf.Header
Assembly: CADability.dll
Syntax
public class HeaderVariables
Constructors
| Improve this Doc View SourceHeaderVariables()
Initializes a new instance of the SystemVariables.
Declaration
public HeaderVariables()
Remarks
The default values are the same ones that are apply to a new AutoCad drawing.
Properties
| Improve this Doc View SourceAcadVer
The AutoCAD drawing database version number.
Declaration
public DxfVersion AcadVer { get; set; }
Property Value
| Type | Description |
|---|---|
| DxfVersion |
Remarks
Only AutoCad2000 and higher DXF versions are supported.
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Only AutoCad2000 and higher DXF versions are supported. |
Angbase
Angle 0 base.
Declaration
public double Angbase { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
Default value: 0.
Angdir
The angle direction.
Declaration
public AngleDirection Angdir { get; }
Property Value
| Type | Description |
|---|---|
| AngleDirection |
Remarks
Default value: CCW.
AttMode
Attribute visibility.
Declaration
public AttMode AttMode { get; set; }
Property Value
| Type | Description |
|---|---|
| AttMode |
Remarks
Default value: Normal.
AUnits
Units format for angles.
Declaration
public AngleUnitType AUnits { get; set; }
Property Value
| Type | Description |
|---|---|
| AngleUnitType |
Remarks
Default value: Decimal degrees.
AUprec
Units precision for angles.
Declaration
public short AUprec { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int16 |
Remarks
Valid values are integers from 0 to 8. Default value: 0.
CeColor
Current entity color.
Declaration
public AciColor CeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| AciColor |
Remarks
Default value: 256 (ByLayer). This header variable only supports indexed colors.
CeLtScale
Current entity line type scale.
Declaration
public double CeLtScale { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
Default value: 1.0.
CeLtype
Current entity line type name.
Declaration
public string CeLtype { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
Default value: ByLayer.
CeLweight
Current entity line weight.
Declaration
public Lineweight CeLweight { get; set; }
Property Value
| Type | Description |
|---|---|
| Lineweight |
Remarks
Default value: -1 (ByLayer).
CLayer
Current layer name.
Declaration
public string CLayer { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
Default value: 0.
CMLJust
Current multiline justification.
Declaration
public MLineJustification CMLJust { get; set; }
Property Value
| Type | Description |
|---|---|
| MLineJustification |
Remarks
Default value: 0 (Top).
CMLScale
Current multiline scale.
Declaration
public double CMLScale { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
Default value: 20.
CMLStyle
Current multiline style.
Declaration
public string CMLStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
Default value: Standard.
DimStyle
Current dimension style.
Declaration
public string DimStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
Default value: Standard.
DwgCodePage
Drawing code page; set to the system code page when a new drawing is created, but not otherwise maintained by AutoCAD.
Declaration
public string DwgCodePage { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Extnames
Controls symbol table naming.
Declaration
public bool Extnames { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Default value: 1.
Controls symbol table naming:
0 = Release 14 compatibility. Limits names to 31 characters in length.
Names can include the letters A to Z, the numerals 0 to 9,
and the special characters dollar sign ($), underscore (_), and hyphen (-).
1 = AutoCAD 2000.
Names can be up to 255 characters in length,
and can include the letters A to Z, the numerals 0 to 9, spaces,
and any special characters not used for other purposes by Microsoft Windows and AutoCAD.
HandleSeed
Next available handle.
Declaration
public string HandleSeed { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
InsBase
Insertion base point for the current drawing.
Declaration
public Vector3 InsBase { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Remarks
When you insert or externally reference the current drawing into other drawings, this base point is used as the insertion base point.
InsUnits
Specifies a drawing units value for automatic scaling of blocks, images, or xRefs when inserted or attached to a drawing.
Declaration
public DrawingUnits InsUnits { get; set; }
Property Value
| Type | Description |
|---|---|
| DrawingUnits |
Remarks
Default value: Unitless.
It is not recommend to change this value, if the LUnits variable has been set to Architectural or Engineering, they require the InsUnits to be set at Inches.
LastSavedBy
User name that saved the file.
Declaration
public string LastSavedBy { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
By default it uses the user name of the person who is currently logged on to the Windows operating system.
This header variable is not compatible with AutoCad2000 or lower versions.
LtScale
Global line type scale.
Declaration
public double LtScale { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
Default value: 1.0.
LUnits
Units format for coordinates and distances.
Declaration
public LinearUnitType LUnits { get; set; }
Property Value
| Type | Description |
|---|---|
| LinearUnitType |
Remarks
Default value: Decimal.
If the LUnits is set to Architectural or Engineering the InsUnits variable will be set to Inches automatically.
LUprec
Units precision for coordinates and distances.
Declaration
public short LUprec { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int16 |
Remarks
Valid values are integers from 0 to 8. Default value: 4.
LwDisplay
Controls the display of line weights on the Model or Layout tab.
Declaration
public bool LwDisplay { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Default value: false.
false = Line weight is not displayed.
true = Line weight is displayed.
MirrText
Controls if the text will be mirrored during a symmetry.
Declaration
public bool MirrText { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
PdMode
Controls the PointShape to draw a point entity.
Declaration
public PointShape PdMode { get; set; }
Property Value
| Type | Description |
|---|---|
| PointShape |
Remarks
Default value: PointShape.Dot.
PdSize
Controls the size of the point figures, except for PDMODE values 0 (Dot) and 1 (Empty).
Declaration
public double PdSize { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
Default value: 0.
A setting of 0 generates the point at 5 percent of the drawing area height.
A positive PDSIZE value specifies an absolute size for the point figures.
A negative value is interpreted as a percentage of the viewport size.
PLineGen
Governs the generation of line type patterns around the vertexes of a 2D polyline.
Declaration
public short PLineGen { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int16 |
Remarks
Default value: 0.
1 = Line type is generated in a continuous pattern around vertexes of the polyline.
0 = Each segment of the polyline starts and ends with a dash.
PsLtScale
Controls paper space line type scaling.
Declaration
public short PsLtScale { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int16 |
Remarks
Default value: 1.
1 = No special line type scaling.
0 = Viewport scaling governs line type scaling.
TdCreate
Local date/time of drawing creation.
Declaration
public DateTime TdCreate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |
Remarks
This date/time is local to the time zone where the file was created.
TdinDwg
Cumulative editing time for this drawing.
Declaration
public TimeSpan TdinDwg { get; set; }
Property Value
| Type | Description |
|---|---|
| System.TimeSpan |
TduCreate
Universal date/time the drawing was created.
Declaration
public DateTime TduCreate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |
TdUpdate
Local date/time of last drawing update.
Declaration
public DateTime TdUpdate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |
Remarks
This date/time is local to the time zone where the file was created.
TduUpdate
Universal date/time the drawing was created.
Declaration
public DateTime TduUpdate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |
TextSize
Default text height.
Declaration
public double TextSize { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
Default value: 2.5.
TextStyle
Current text style.
Declaration
public string TextStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
Default value: Standard.
UcsOrg
Origin of current UCS (in WCS).
Declaration
public Vector3 UcsOrg { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
UcsXDir
Direction of the current UCS X axis (in WCS).
Declaration
public Vector3 UcsXDir { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Remarks
The vectors UcsXDir and UcsYDir must be perpendicular.
UcsYDir
Direction of the current UCS Y axis (in WCS).
Declaration
public Vector3 UcsYDir { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Remarks
The vectors UcsXDir and UcsYDir must be perpendicular.
Methods
| Improve this Doc View SourceAddCustomVariable(HeaderVariable)
Adds a custom HeaderVariable to the list.
Declaration
public void AddCustomVariable(HeaderVariable variable)
Parameters
| Type | Name | Description |
|---|---|---|
| HeaderVariable | variable | Header variable to add to the list. |
Remarks
All header variable names must start with the character '$'.
Header variable names that already exists in the known list cannot be added.
ClearCustomVariables()
Removes all custom HeaderVariable from the list.
Declaration
public void ClearCustomVariables()
ContainsCustomVariable(String)
Checks if a custom HeaderVariable name exits in the list.
Declaration
public bool ContainsCustomVariable(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Header variable name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if a header variable name exits in the list; otherwise, false. |
Remarks
The header variable name is case insensitive.
CustomNames()
Gets a collection of the custom header variables names.
Declaration
public List<string> CustomNames()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | A list with the custom header variables names. |
CustomValues()
Gets a collection of the custom header variables.
Declaration
public List<HeaderVariable> CustomValues()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<HeaderVariable> | A list with the custom header variables. |
KnownNames()
Gets a collection of the known header variables names.
Declaration
public List<string> KnownNames()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | A list with the known header variables names. |
KnownValues()
Gets a collection of the known header variables.
Declaration
public List<HeaderVariable> KnownValues()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<HeaderVariable> | A list with the known header variables. |
RemoveCustomVariable(String)
Removes a custom HeaderVariable from the list.
Declaration
public bool RemoveCustomVariable(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Header variable to add to the list. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the element is successfully found and removed; otherwise, false. |
Remarks
The header variable name is case insensitive.
TryGetCustomVariable(String, out HeaderVariable)
Gets the header variable associated with the specified name.
Declaration
public bool TryGetCustomVariable(string name, out HeaderVariable variable)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the header variable to get. |
| HeaderVariable | variable | When this method returns, contains the header variable associated with the specified name, if the name is found; otherwise, it contains null. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the list contains a header variable with the specified name; otherwise, false. |