Property ActiveLayer
- Namespace
- VectorDraw.Professional.vdObjects
- Assembly
- VectorDraw.Professional.dll
ActiveLayer
Get/Set the active vdLayer of the document.
public vdLayer ActiveLayer { get; set; }
Property Value
Examples
Changes the ActiveLayer and create a new vdLine that reference to this layer.
//create a new vdLayer with name "MyNewLayer" and make it as active.
vdLayer layer = doc.Layers.Add("MyNewLayer");
doc.ActiveLayer = layer;
//create a new line entitity
vdLine line = new vdLine();
//select the document that the line is reference to.
line.SetUnRegisterDocument(doc);
//select the default active properties of the document object for the entity
line.setDocumentDefaults();
Console.WriteLine(line.Layer.Name);//the output will be "MyNewLayer"
Remarks
This property is used when setDocumentDefaults() is called.
Default value:null.
Raizes the OnBeforeModifyObject event and the OnAfterModifyObject event.
Exceptions
- InvalidPropertyValueException
When setting to a layer that does not exist in the Layers collection or EnableActiveLayerFrozen is false and setting to a layer that is Frozen.