Constructors
Properties
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.
ComponentStatus
Gets or sets the component status of the model component.
Returns ModelComponentType.LinePattern.
Overrides: ModelComponent.ComponentType
Disposed
Indicates if this object has been disposed or the document it originally belonged to has been disposed.
HasUserData
Gets true if this class has any custom information attached to it through UserData.
Exceptions:
| InvalidOperationException | When 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.
Exceptions:
| InvalidOperationException | When 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.
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.
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.
Returns true if the linetype is in use by a Rhino object, a layer, an instance definition, or a section style.
IsComponentStatusLocked
The component status itself can be locked. This returns an indication.
Gets a value indicating whether this linetype has been deleted and is currently in the Undo buffer.
Overrides: ModelComponent.IsDeleted
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.
true if this linetype has been modified by LinetypeTable.ModifyLinetype() and the modifications can be undone.
Returns true if the pattern is locked and cannot be modified.
Gets a value indicting whether this linetype is a referenced linetype. Referenced linetypes are part of referenced documents.
Overrides: ModelComponent.IsReference
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
Defines how the ends of open curves should be drawn
Defines how the corners of curves should be drawn
The index of this linetype.
ModelSerialNumber
A value identifying the model that manages this component.
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.
The name of this linetype.
Overrides: ModelComponent.Name
NameIsLocked
Returns a value indicating whether the component Name is already locked.
Total length of one repeat of the pattern.
ReferenceModelSerialNumber
When a component is in a model for reference, this value identifies the reference model.
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.
The bounding box of the shapes in this linetype definition.
If shapes are present in this linetype, this is the gap around the shape.
Local offset applied to shapes
If shapes are present in this linetype, this is the distance between shapes
UserData
List of custom information that is attached to this class.
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.
Unit system that widths are defined in. UnitSystem.None is default and means that the width is defined in pixels.
Methods
Add a curve shape to this linetype definition
Add text as a shape to this linetype definition
Parameters:
| text (TextEntity) | |
| offset (double) |
Adds a segment to the pattern.
ClearId
public void ClearId()
Resets the HasId property of the model component to false, if possible.
Exceptions:
| InvalidOperationException | If the ID is locked. |
ClearIndex
public void ClearIndex()
Resets the HasIndex property of the model component to false, if possible.
Exceptions:
| InvalidOperationException | If the index is locked. |
ClearName
public void ClearName()
Resets the HasName property of the model component to false, if possible.
Exceptions:
| InvalidOperationException | If the name is locked. |
ConstructConstObject
Assigns a parent object and a sub-object index to this.
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.
DataCRC
Increments the Cyclic Redundancy Check value by this instance.
Parameters:
| currentRemainder (uint) | The current remainder value. |
Returns: The updated remainder value.
public void DeleteAllUserStrings()
Dispose
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.
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.
Parameters:
| disposing (bool) | true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer. |
Duplicates a linetype, clears the name, id, and locked bits.
Returns: The duplicated linetype if successful, null otherwise.
EnsurePrivateCopy
public void 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.
GetObjectData
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
Parameters:
| info (SerializationInfo) | The System.Runtime.Serialization.SerializationInfo to populate with data. |
| context (StreamingContext) | The destination (see System.Runtime.Serialization.StreamingContext) for this serialization. |
Gets the segment information at a index.
Parameters:
| index (int) | Zero based index of the segment. |
| length (out double) | The length of the segment in millimeters. |
| isSolid (out bool) | 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. |
Exceptions:
| IndexOutOfRangeException | If the index is unacceptable. |
Taper points are positions/width combinations along the length of a curve
Gets user string from this geometry.
Parameters:
| key (string) | id used to retrieve the string. |
Returns: string associated with the key if successful. null if no key was found.
Gets a copy of all (user key string, user value string) pairs attached to this geometry.
Returns: A new collection.
IsValidWithLog
Determines if an object is valid. Also provides a report on errors if this object happens not to be valid.
Parameters:
| log (out string) | A textual log. This out parameter is assigned during this call. |
Returns: true if this object is valid; false otherwise.
LockId
public void LockId()
Locks the component Id property.
LockIndex
public void LockIndex()
Locks the component Index property.
LockName
public void LockName()
Locks the component Name property.
NonConstOperation
protected virtual void NonConstOperation()
For derived classes implementers.
Defines the necessary implementation to free the instance from being constant.
OnSwitchToNonConst
protected virtual void OnSwitchToNonConst()
Is called when a non-constant operation first occurs.
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.
Parameters:
| millimeters (bool) | If true, the string is formatted in millimeters. If false, the string is formatted in inches. |
Returns: The pattern string.
Reads linetypes from either a Rhino .3dm file or an AutoCAD .lin file.
Parameters:
| path (string) | The path to the file to read. |
Returns: An array of linetypes if successful, otherwise an empty array.
Removes a segment in the linetype.
Parameters:
| index (int) | Zero based index of the segment to remove. |
Returns: true if the segment index was removed.
Sets the length and type of the segment at index.
Set all segments.
Parameters:
| segments (IEnumerable<double>) | An array of segments lengths. Lengths >= 0 are interpreted as a line. Lengths < 0 are interpreted as a space. |
Returns: true if the segments were replaced
Set taper to a simple start width / end width
Set taper for this linetype width a single internal taper point
Attach a user string (key,value combination) to this geometry.
ToJSON
Create a JSON string representation of this object
Parameters:
| options (SerializationOptions) |
ToString
Returns the name of the model component type, and then its name and index.
Remarks: This is provided as a visual aid. Do not rely on this for serialization.
Overrides: Object.ToString