Message 1 of 5
Not applicable
12-29-2016
10:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everybody!
I am trying to find the nearest lower (and upper) level from a point.
I have been able to fint the nearest element (eg. a floor) using the next code:
ReferenceIntersector refIntersector = new ReferenceIntersector(view3D); ReferenceWithContext referenceWithContext = refIntersector.FindNearest(elemPoint, new XYZ(0,0,-1)); Reference reference = referenceWithContext.GetReference(); XYZ lowerLevel = reference.GlobalPoint;
It finds the nearest element, but, unortunately, id does not find the nearest level.
I have tried using also it:
ElementClassFilter filter = new ElementClassFilter(typeof(Level)); ReferenceIntersector refIntersector = new ReferenceIntersector(filter, FindReferenceTarget.All,view3D);
but it does not work....
Any idea??
Thanks in advance!
Chema
Solved! Go to Solution.