Message 1 of 9

Not applicable
02-28-2018
09:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I use ReferenceIntersector.FindNearest, it will find a wall, but it doesn't find a curtain wall.
My code is:
var view3d = RUtils.Get3dView(doc); ReferenceIntersector refIntersector = new ReferenceIntersector( new ElementCategoryFilter(BuiltInCategory.OST_Walls), FindReferenceTarget.Element, view3d ); var x = refIntersector.FindNearest(stairBase, baseDirection);
and after executing this, the `x` is `null`.
I know the base point and direction are fine because when I change the type of wall in the UI to be, say "Interior - Partition" instead of "SH_Curtain wall" and rerun the code, then it does find it. I expect it to intersect the curtain wall also since using the Revit Lookup tool, the curtain wall has BuiltinCategory of "OST_Walls" (just like the partition wall).
BTW, the function for getting the 3d view is:
public static View3D Get3dView(Document doc, bool createIfNull=true) { FilteredElementCollector collector = new FilteredElementCollector(doc).OfClass(typeof(View3D)); foreach (var elem in collector) { var view = (View3D) elem; if (view.IsTemplate || view.IsPerspective) { continue; } if (view.IsSectionBoxActive) { var trans = new Transaction(doc); trans.Start("disable section box"); view.IsSectionBoxActive = false; doc.Regenerate(); trans.Commit(); return view; } } return createIfNull ? create3dView(doc) : null; }
How can I have it intersect the curtain wall also?
Solved! Go to Solution.