Message 1 of 2
Iselection filter for massing

Not applicable
03-14-2011
04:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to write a Iselection filter to only have my UI select Mass in the revit document. I have done it for roof element, the code is as follow: public class MySelectionFilter : ISelectionFilter { public bool AllowElement(Element elem) { return elem is RoofBase; } public bool AllowReference(Reference reference, XYZ position) { return true; } } public Result Execute( ExternalCommandData commandData, ref string message, ElementSet elements) { try { while (true) { UIDocument doc = commandData.Application.ActiveUIDocument; //pick an object from the document that is of roof type Reference selRef = doc.Selection.PickObject(ObjectType.Element, new MySelectionFilter(), "select a roof"); //turn the selected object into a roof element RoofBase roof = (RoofBase)selRef.Element; so i tried to modify the script by wanting to change return elem is RoofBase to return elem is Mass, but I realise there is no massing class in Revit API? Or is there any other that I can limit my UI selection filter to only select the massing objects in my document ? Thanks