- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
public class addPickFilter : ISelectionFilter
{
public bool AllowElement(Element e)
{
return (e.Category.Id.IntegerValue.Equals((int)BuiltInCategory.OST_Rooms));
}
public bool AllowReference(Reference r, XYZ p)
{
return false;
}
}
Is there a way to change this class after creating it? I am trying to create a dynamic element selection filter that changes allowed elements to be selected based on user input. So if the user selects one option it would allow him to select only rooms, or he can choose to be able to select only walls, or he can choose to be able to select rooms and walls.
The only way I can think of doing this is by creating a class with ISelectionFilter interface for every possible outcome....
Is there a better way? maybe I could pass an input variable to this class for filter types (=not sure how that works with the interface, because my assumption is that interface has inputs predefined)
Or is there a way to do pass multiple filters to Selection.PickObjects() ? Something like
IList<Reference> objects = sel.PickObjects(ObjectType.Element, roomPickFilter + wallPickFilter, "Select objects");
Solved! Go to Solution.