ReferenceIntersector return distance

ReferenceIntersector return distance

Anonymous
Not applicable
375 Views
1 Reply
Message 1 of 2

ReferenceIntersector return distance

Anonymous
Not applicable

I'm experimenting with ReferenceIntersector and I don't understand the problem i'm having with distance. I'm filtering for columns and If I use 'referenceIntersector.Find' it returns a list of columns intersecting along the direction. But if I use 'referenceIntersector.FindNearest' I can only get a column if it's less than 1'-6" away. What am I missing or what should I be looking for? My start and direction XYZ are both (0,0,0).

 

            ElementFilter columnFilter = new ElementCategoryFilter(BuiltInCategory.OST_StructuralColumns);
            ReferenceIntersector referenceIntersector = new ReferenceIntersector(columnFilter, FindReferenceTarget.Element, view3D);
            ReferenceWithContext referenceWithContext = referenceIntersector.FindNearest(_rayStart, _rayDirection);
0 Likes
376 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk

Dear Bthatcher,

 

Thank you for your query.

 

Maybe your 3D view is set up to eliminate all geometry outside certain bounds?

 

Here are two discussions on using FindNearest by The Building Coder:

 

http://thebuildingcoder.typepad.com/blog/2014/09/a-couple-of-recent-issues.html#4

 

http://thebuildingcoder.typepad.com/blog/2014/01/future-proofing-the-building-coder-samples.html

 

The Building Coder samples also includes sample code for that:

 

https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/C...

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder