Table of Contents

Class vdLineTypes

Namespace
VectorDraw.Professional.vdCollections
Assembly
VectorDraw.Professional.dll

Represents a collection ofvdLineType objects and provides all management functionality for line type definitions used by a LineTypes. vdLineType objects define the pattern of lines (solid, dashed, dotted, etc.) used in drawing entities (LineType). The collection is responsible for creation, lookup, update and removal of line types, maintains fast name and id dictionaries and supplies a set of standard (default) line types such as SOLID, BYLAYER and BYBLOCK.

public sealed class vdLineTypes : vdBaseObject, IDisposable, IVDSerialise, IEnumerable, IBaseObject
Inheritance
vdLineTypes
Implements
Inherited Members

Examples

The following code snippet demonstrates how to create a custom dashed line type and apply it to a line entity in a vDocument.

// Use your existing new vDocument object as (doc)

var linetype = doc.LineTypes.Add("mydashed");
linetype.Comment = "MYDASHED- - - - - - - - - ";
linetype.Segments = new LineTypeSegments(new double[] {0.5,-0.25 });//0.5 unit dash followed by 0.25 unit gap, repeated
doc.LineTypes.AddItem(linetype);
vdLine line1 = new vdLine(doc, new gPoint(-5, -5), new gPoint(5, 5));
line1.LineType = linetype;
doc.Model.Entities.AddItem(line1);
doc.Redraw(false);

Remarks

Key behaviors:

  • Fast lookup: names and ids are indexed via internal dictionaries for quick retrieval.
  • Default line types: standard items (SOLID, BYLAYER, BYBLOCK, DASHED0, DOT0, DASHDOT0, DASHDOTDOT0, INVISIBLE) are ensured via EnsureDefaults() / EnsureDefault.
  • Document lifecycle: when registered to a LineTypes the collection raises document events for add/remove operations and participates in serialization.
  • Serialization: implements custom serialize/deserialize logic to persist non-deleted items.
  • Ownership: when items are added the collection sets the item's Owner and document; removing or clearing the collection will unset ownership and reset handles as appropriate.

Constructors

vdLineTypes()

Initializes the vdLineTypes collection objects and also the default linetype objects.

Properties

ByBlock

Setting the linetype to BYBLOCK means that an object assumes the Solid linetype until it is grouped into a block. Whenever the block is inserted, all objects inherit the block's linetype.

ByLayer

Setting the linetype to BYLAYER means that an object assumes the linetype that is assigned to the object's layer. If the object that has the linetype, belongs to a block and the block is inserted in Standard (Layer 0), then the object inherit the block's Linetype.

Count

Get the item's count of the collection.

DPIDash

Gets and ensures existance of the default dash linetype.

DPIDashDot

Gets and ensures existance of the default dash dot linetype.

DPIDashDotDot

Gets and ensures existance of the default dash dot dot linetype.

DPIDot

Gets and ensures existance of the default dot linetype.

Invisible

Represents an invisible linetype.

this[int]

Get a vdLineType object from the collection at a specified index.

ItemType

Returns the Type of Items in the collection

Last

Returns the last item in the collection.

Solid

Gets and ensures existance of the default Solid linetype.

Methods

Add(object)

Adds an object to the end of the collection.

Add(string)

Creates and adds a vdLineType object to the collection with the specified name.

AddItem(object)

Adds an object to the collection.

AddItem(vdLineType)

Adds a vdLineType object to the collection.

AddResolveProperty(object, string, string)

Adds the parameters to the resolve list of the collection.

ChangeOrder(vdLineType, bool)

Changes the position of a vdLineType object to the front or the end of the collection.

ClearIndexDictionary()

Clears the Index of the Dictionary. Internally used to speed up Swap method.

DeSerialize(DeSerializer, string, object)

This Function is called foreach field name of the vdLinetypes object when opening in vdml format.

Dispose()

Releases all resources used by this object.

EnsureDefaults()

Ensures the existance of the standard vdLineType objects.

FindItem(object)

Checks if an object exists in the collection.

FindItem(vdLineType)

Checks if an object exists in the collection.

FindName(string)

Finds a vdLineType object with the specified name in the collection.

GetEnumerator()

Implements the "foreach" expression for the collection.

GetNotDeletedItems()

Get all non deleted objects of the collection.

GetNotDeletedItemsAndVisibleOnForms()

Get all non deleted objects of the collection.

GetObjectRealPosition(object)

Find the index where a specified object is located in the list.

InitDefaults(vdDocument)

Initializes vdLineType objects in the collection.

InsertAt(int, object)

Insert an object at a specified index.

InsertAt(int, vdLineType)

Insert a vdLineType object to a specified index of the collection.

InsertCopyOf(vdLineType)

Adds a clone of the obj in the collection if it is not exist.

InternalSetOwner(vdBaseObject)

Internally used only.

Set the object owner

IsDefault(vdPrimary)

Checks if the parameter passed is one of the standard vdLineType objects.

Load(Stream, bool)

Add a collection of linetypes that defined in the .lin file.

Load(string, bool)

Add a collection of linetypes that defined in the .lin file.

LoadLinWithDlg(bool)

Opens a System.Windows.Forms.OpenFileDialog dialog in order the user to select a .Lin file and then loads the file to the linetypes.

MakeIndexDictionary()

Creates an Index of the Dictionary. Internally used to speed up Swap method.

Purge()

Sets as Deleted all vdLineType that are not being used in the Collection's Document.

RemoveAll()

Removes all objects from the collection.

RemoveAt(int)

Removes an object from the specified index of the collection.

RemoveItem(object)

Removes an object from the collection.

RemoveItem(vdLineType)

Removes a specific vdLineType object from the collection.

ResolveProperties()

Resolves all the properties added with the AddResolveProperty(object, string, string) function.

Serialize(Serializer)

This Function is called when saving the vdLinetypes object to vdml format.

ToString()

Gets a System.String that represents the count of the vdLinetypes collection Object.

UpdateTextStyles()

Updates all textstyles used in Linetypes.

getUniqueTableName(string)

Creates a unique string for use as name to a vdLineType object.

isDefaultLinetype(string)

Checks if the passed name is a default linetype

swap(vdLineType, vdLineType)

Swaps the position between two different vdLineType objects existing in the collection.

See Also