60000368 How can i filter select ALL polylines of ALL layers of a specific layout of a document

Article 60000368
Type HowTo
Product Engine
Date Added 1/3/2008 12:00:00 AM
Fixed (1/3/2008 12:00:00 AM)
Submitted by Peter chanios

Summary

How can i filter select ALL polylines of ALL layers of a specific layout of a document.

Solution

//Create a selection
VectorDraw.Professional.vdCollections.vdSelection selset = new vdSelection("Myselset");
selset.SetUnRegisterDocument(vdFramedControl1.BaseControl.ActiveDocument);

//Create a filter
VectorDraw.Professional.vdObjects.vdFilterObject filter = new vdFilterObject();

//Add ALL Layer names to the filter(you can add simply 1 layer if you want
foreach (vdLayer var in vdFramedControl1.BaseControl.ActiveDocument.Layers)
{
filter.Layers.AddItem(var.Name);
}

//Add vdPolyline to select all polylines
filter.Types.AddItem("vdPolyline");

//Add the name of the layout you want to check if no name is specified then ALL layouts will be checked
filter.LayOuts.AddItem(vdFramedControl1.BaseControl.ActiveDocument.ActiveLayOut.Name);

//Apply the filter. After this the selection will contain the selected polylines.
selset.FilterSelect(filter);

Send comments on this topic.