Constructors

Linetype

#Since v5.0
public Linetype()

Linetype

#Since v8.0
public Linetype(
Linetype
other
)

Properties

AlwaysModelDistances

#Since v8.6
Linetype patterns and widths are typically interpreted as distances on the printed output when printing. In this case AlwaysModelDistances is false (default). When set to true, the linetype pattern and width will be interpreted as being in world distances. This is useful for cases like modeling a road as a single curve.
public bool AlwaysModelDistances { get; set; }

ComponentStatus

Gets or sets the component status of the model component.
public virtual ComponentStatus ComponentStatus { get; set; }
inherited fromModelComponent

ComponentType

#Since v6.0
public override ModelComponentType ComponentType { get; }

DeletedName

Gets the name of a component that is deleted.
public string DeletedName { get; }
inherited fromModelComponent

Disposed

Indicates if this object has been disposed or the document it originally belonged to has been disposed.
public bool Disposed { get; }
inherited fromCommonObject

HasId

Returns a value indicating whether the component has an ID.
public bool HasId { get; }
inherited fromModelComponent

HasIndex

Returns a value indicating whether the component has an Index.
public bool HasIndex { get; }
inherited fromModelComponent

HasName

Returns a value indicating whether the component has a Name.
public bool HasName { get; }
inherited fromModelComponent

HasShapes

#Since v9.0
Does this linetype have shapes
public bool HasShapes { get; }

HasUserData

Gets true if this class has any custom information attached to it through UserData.
public bool HasUserData { get; }
inherited fromCommonObject

Id

Gets or sets the ID of the current instance.
public virtual Guid Id { get; set; }
inherited fromModelComponent
InvalidOperationExceptionWhen setting the ID failed. This usually happened because the instance ID is already locked.

IdIsLocked

Returns a value indicating whether the component ID is already locked.
public bool IdIsLocked { get; }
inherited fromModelComponent

Index

Gets or sets the model component index attribute.
public virtual int Index { get; set; }
inherited fromModelComponent
InvalidOperationExceptionWhen setting the Index failed. This usually happens because the instance Index is already locked.

IndexIsLocked

Returns a value indicating whether the component Index is already locked.
public bool IndexIsLocked { get; }
inherited fromModelComponent

InstanceDefinitionModelSerialNumber

When a component is in a model as part of the information required for a linked instance definition, this value identifies the linked instance definition reference model.
[CLSCompliant(false)] public virtual uint InstanceDefinitionModelSerialNumber { get; }
inherited fromModelComponent
Remarks: Reference components are not saved in .3dm archives. Typically this value is set and locked by the code that adds a component to a model. This value is not saved in .3dm archives.

InUse

#Since v8.7
Returns true if the linetype is in use by a Rhino object, a layer, an instance definition, or a section style.
public bool InUse { get; }

IsComponentStatusLocked

The component status itself can be locked. This returns an indication.
public bool IsComponentStatusLocked { get; }
inherited fromModelComponent

IsDeleted

#Since v5.0
Gets a value indicating whether this linetype has been deleted and is currently in the Undo buffer.
public override bool IsDeleted { get; }

IsDocumentControlled

If true this object may not be modified. Any properties or functions that attempt to modify this object when it is set to "IsReadOnly" will throw a NotSupportedException.
public virtual bool IsDocumentControlled { get; }
inherited fromCommonObject

IsModified

#Since v5.0
true if this linetype has been modified by LinetypeTable.ModifyLinetype() and the modifications can be undone.
public bool IsModified { get; }

IsPatternLocked

#Since v8.0
Returns true if the pattern is locked and cannot be modified.
public bool IsPatternLocked { get; }

IsReference

#Since v5.0
Gets a value indicting whether this linetype is a referenced linetype. Referenced linetypes are part of referenced documents.
public override bool IsReference { get; }

IsSystemComponent

True if this model component is a system constant.

An incomplete list of system constant model components is below:

  • ON_ModelComponent::Unset

  • ON_InstanceDefinition::Empty

  • ON_Linetype::Unset
  • ON_Linetype::Continuous
  • ON_Linetype::ByLayer
  • ON_Linetype::ByParent

  • ON_Layer::Unset
  • ON_Layer::Default

  • ON_TextStyle::Unset
  • ON_TextStyle::Default
  • ON_TextStyle::ByLayer
  • ON_TextStyle::ByParent

  • ON_DimStyle::Unset
  • ON_DimStyle::Default
  • ON_DimStyle::DefaultInchDecimal
  • ON_DimStyle::DefaultInchFractional
  • ON_DimStyle::DefaultFootInchArchitecture
  • ON_DimStyle::DefaultMillimeterSmall
  • ON_DimStyle::DefaultMillimeterLarge
  • ON_DimStyle::DefaultMillimeterArchitecture
public bool IsSystemComponent { get; }
inherited fromModelComponent

IsValid

Tests an object to see if it is valid.
public virtual bool IsValid { get; }
inherited fromCommonObject

LineCapStyle

#Since v8.0
Defines how the ends of open curves should be drawn
public LineCapStyle LineCapStyle { get; set; }

LineJoinStyle

#Since v8.0
Defines how the corners of curves should be drawn
public LineJoinStyle LineJoinStyle { get; set; }

LinetypeIndex

#Since v5.0
The index of this linetype.
[EditorBrowsable(EditorBrowsableState.Never)] public int LinetypeIndex { get; set; }

ModelSerialNumber

A value identifying the model that manages this component.
[CLSCompliant(false)] public virtual uint ModelSerialNumber { get; }
inherited fromModelComponent
Remarks: If the component is being managed by a model, this value identifies the model. In Rhino, this value is the document runtime serial number. Typically this value is set and locked by the code that adds a component to a model. This value is not saved in .3dm archives.

Name

#Since v5.0
The name of this linetype.
public override string Name { get; set; }

NameIsLocked

Returns a value indicating whether the component Name is already locked.
public bool NameIsLocked { get; }
inherited fromModelComponent

PatternLength

#Since v5.0
Total length of one repeat of the pattern.
public double PatternLength { get; }

ReferenceModelSerialNumber

When a component is in a model for reference, this value identifies the reference model.
[CLSCompliant(false)] public virtual uint ReferenceModelSerialNumber { get; }
inherited fromModelComponent
Remarks: Reference components are not saved in .3dm archives. Typically this value is set and locked by the code that adds a component to a model. This value is not saved in .3dm archives.

SegmentCount

#Since v5.0
Number of segments in the pattern.
public int SegmentCount { get; }

ShapeBounds

#Since v9.0
The bounding box of the shapes in this linetype definition.
public BoundingBox ShapeBounds { get; }

ShapeGap

#Since v9.0
If shapes are present in this linetype, this is the gap around the shape.
public double ShapeGap { get; set; }

ShapeLocalOffset

#Since v9.0
Local offset applied to shapes
public Vector2d ShapeLocalOffset { get; set; }

ShapeSpacing

#Since v9.0
If shapes are present in this linetype, this is the distance between shapes
public double ShapeSpacing { get; set; }

UserData

List of custom information that is attached to this class.
public UserDataList UserData { get; }
inherited fromCommonObject

UserDictionary

Dictionary of custom information attached to this class. The dictionary is actually user data provided as an easy to use shareable set of information.
public ArchivableDictionary UserDictionary { get; }
inherited fromCommonObject

UserStringCount

#Since v8.9
Gets the amount of user strings.
public int UserStringCount { get; }

Width

#Since v8.0
Base width for this linetype
public double Width { get; set; }

WidthUnits

#Since v8.0
Unit system that widths are defined in. UnitSystem.None is default and means that the width is defined in pixels.
public UnitSystem WidthUnits { get; set; }

Methods

AddShape

#Since v9.0
Add a curve shape to this linetype definition
public bool AddShape(
shapeCurve,
offset
)

AddShape

#Since v9.0
Add text as a shape to this linetype definition
public bool AddShape(
text,
offset
)

AppendSegment

#Since v5.0
Adds a segment to the pattern.
public int AppendSegment(
length,
The length of the segment to be added.
isSolid
If true, the length is interpreted as a line. If false, then the length is interpreted as a space.
)
Index of the added segment.

ClearId

Resets the HasId property of the model component to false, if possible.
public void ClearId()
inherited fromModelComponent
InvalidOperationExceptionIf the ID is locked.

ClearIndex

Resets the HasIndex property of the model component to false, if possible.
public void ClearIndex()
inherited fromModelComponent
InvalidOperationExceptionIf the index is locked.

ClearName

Resets the HasName property of the model component to false, if possible.
public void ClearName()
inherited fromModelComponent
InvalidOperationExceptionIf the name is locked.

CommitChanges

#Since v5.0
public bool CommitChanges()

ConstructConstObject

Assigns a parent object and a sub-object index to this.
protected void ConstructConstObject(
parentObject,
The parent object.
subobjectIndex
The sub-object index.
)
inherited fromCommonObject

CreateFromPatternString

#Since v7.4
Creates a linetype from a pattern string. Values greater than zero represent line segments, and values less than or equal to zero represents space segments.
public static Linetype CreateFromPatternString(
patternString,
The pattern string.
millimeters
Specify true if the pattern is represented in millimeters. Specify false if the pattern is represented in inches.
)
A valid linetype if successful, null otherwise.

DataCRC

Increments the Cyclic Redundancy Check value by this instance.
[CLSCompliant(false)] public uint DataCRC(
currentRemainder
The current remainder value.
)
inherited fromModelComponent
The updated remainder value.

Default

#Since v5.0
Set linetype to default settings.
public void Default()

DeleteAllUserStrings

#Since v8.9
public void DeleteAllUserStrings()

DeleteUserString

#Since v8.9
public bool DeleteUserString(
key
)

Dispose

Actively reclaims unmanaged resources that this instance uses.
public void Dispose()
inherited fromCommonObject

Dispose

For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

protected virtual void Dispose(
disposing
true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.
)
inherited fromCommonObject

DuplicateLinetype

#Since v8.0
Duplicates a linetype, clears the name, id, and locked bits.
public Linetype DuplicateLinetype()
The duplicated linetype if successful, null otherwise.

EnsurePrivateCopy

If you want to keep a copy of this class around by holding onto it in a variable after a command completes, call EnsurePrivateCopy to make sure that this class is not tied to the document. You can call this function as many times as you want.
public void EnsurePrivateCopy()
inherited fromCommonObject

GetObjectData

Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public virtual void GetObjectData(
info,
The System.Runtime.Serialization.SerializationInfo to populate with data.
context
The destination (see System.Runtime.Serialization.StreamingContext) for this serialization.
)
inherited fromCommonObject

GetSegment

#Since v5.0
Gets the segment information at a index.
public void GetSegment(
index,
Zero based index of the segment.
out double
length,
The length of the segment in millimeters.
out bool
isSolid
If the length is interpreted as a line, true is assigned during the call to this out parameter.

If the length is interpreted as a space, then false is assigned during the call to this out parameter.

)
IndexOutOfRangeExceptionIf the index is unacceptable.

GetTaperPoints

#Since v8.0
Taper points are positions/width combinations along the length of a curve
public Point2d[] GetTaperPoints()

GetUserString

#Since v8.9
Gets user string from this geometry.
public string GetUserString(
key
id used to retrieve the string.
)
string associated with the key if successful. null if no key was found.

GetUserStrings

#Since v8.9
Gets a copy of all (user key string, user value string) pairs attached to this geometry.
public NameValueCollection GetUserStrings()
A new collection.

IsValidWithLog

Determines if an object is valid. Also provides a report on errors if this object happens not to be valid.
public bool IsValidWithLog(
out string
log
A textual log. This out parameter is assigned during this call.
)
inherited fromCommonObject
true if this object is valid; false otherwise.

LockId

Locks the component Id property.
public void LockId()
inherited fromModelComponent

LockIndex

Locks the component Index property.
public void LockIndex()
inherited fromModelComponent

LockName

Locks the component Name property.
public void LockName()
inherited fromModelComponent

NonConstOperation

For derived classes implementers.

Defines the necessary implementation to free the instance from being constant.

protected virtual void NonConstOperation()
inherited fromCommonObject

OnSwitchToNonConst

Is called when a non-constant operation first occurs.
protected virtual void OnSwitchToNonConst()
inherited fromCommonObject

PatternString

#Since v7.4
Returns a string that represents the pattern of the linetype, which can be used in user interface. Values greater than zero represent line segments, and values less than or equal to zero represent space segments.
public string PatternString(
millimeters
If true, the string is formatted in millimeters. If false, the string is formatted in inches.
)
The pattern string.

ReadFromFile

#Since v6.6
Reads linetypes from either a Rhino .3dm file or an AutoCAD .lin file.
public static Linetype[] ReadFromFile(
path
The path to the file to read.
)
An array of linetypes if successful, otherwise an empty array.

RemoveAllShapes

#Since v9.0
Remove all shapes from this linetype
public void RemoveAllShapes()

RemoveSegment

#Since v5.0
Removes a segment in the linetype.
public bool RemoveSegment(
index
Zero based index of the segment to remove.
)
true if the segment index was removed.

RemoveTaper

#Since v8.0
Remove taper information for stroke
public void RemoveTaper()

SetSegment

#Since v5.0
Sets the length and type of the segment at index.
public bool SetSegment(
index,
Zero based index of the segment.
length,
The length of the segment to be added in millimeters.
isSolid
If true, the length is interpreted as a line. If false, then the length is interpreted as a space.
)
true if the operation was successful; otherwise false.

SetSegments

#Since v6.8
Set all segments.
public bool SetSegments(
segments
An array of segments lengths. Lengths >= 0 are interpreted as a line. Lengths < 0 are interpreted as a space.
)
true if the segments were replaced

SetTaper

#Since v8.0
Set taper to a simple start width / end width
public void SetTaper(
startWidth,
endWidth
)

SetTaper

#Since v8.0
Set taper for this linetype width a single internal taper point
public void SetTaper(
startWidth,
taperPoint,
endWidth
)

SetUserString

#Since v8.9
Attach a user string (key,value combination) to this geometry.
public bool SetUserString(
key,
id used to retrieve this string.
value
string associated with key.
)
true on success.

ToJSON

Create a JSON string representation of this object
public string ToJSON()
inherited fromCommonObject

ToString

Returns the name of the model component type, and then its name and index.
public override string ToString()
inherited fromModelComponent
Remarks: This is provided as a visual aid. Do not rely on this for serialization.
Object.ToString