Article | 70000575 |
Type | Bug |
Product | Engine |
Version | 7005 |
Date Added | 9/28/2015 |
Fixed | 7.7006.0.2 (9/28/2015) |
Submitted by | Vissarion Giorspyros |
Summary
I would like to filter entities by Properties using vdFilterObject.
Solution
A new event was added in the vdFilterObject type by the name FilterProperty. Using this event custom filtering can be performed for each object in the filter collection. Using this event you can perform checks of certain properties of your objects.
Example
vdFilterObject fo = new vdFilterObject();
fo.FilterProperty += new vdFilterObject.FilterPropertyEventHandler(fo_FilterProperty);
vdSelection set = new vdSelection();
set.SetUnRegisterDocument(doc);
set.FilterSelect(fo);
void fo_FilterProperty(object sender, vdFigure fig, ref bool AddTo)
{
if (fig.Owner != doc.Model.Entities) AddTo = false;//If figure not in Model, it is ignored.
else if (fig.LineWeight != VectorDraw.Professional.Constants.VdConstLineWeight.LW_211) AddTo = false;//If figure has line weight other than 211 it is ignored.
}