Insulation in FabricationPart doesn't get intersected through ReferenceIntersect

Insulation in FabricationPart doesn't get intersected through ReferenceIntersect

JeffYao28
Enthusiast Enthusiast
467 Views
4 Replies
Message 1 of 5

Insulation in FabricationPart doesn't get intersected through ReferenceIntersect

JeffYao28
Enthusiast
Enthusiast

Dear Support or any Advocates,

 

FabricationPart class has a property called InsulationThickness. When this value is greater than zero, using ReferenceIntersector to try to project a line only through the insulation doesn’t get any intersection in the result.

This is my code snippet:

 

var referenceIntersector = new ReferenceIntersector(new ElementIsElementTypeFilter(true), FindReferenceTarget.All, myView3D);

var theResult = referenceIntersector.Find(myOriginXYZ, XYZ.BasisZ);

 

It would be great if Revit API can somehow find the intersection of a line with fabrication part including insulation. It doesn’t matter whether the API distinguish the insulation from the main body of the part.

 

Thank you in advance!

 

Jeff Yao

 

0 Likes
468 Views
4 Replies
Replies (4)
Message 2 of 5

JimJia
Alumni
Alumni

Dear Jeff, 

 

Can you help to ensure the insulation is visible in your 3d view? note that the ReferenceIntersector will not get elements which are invisible in specified view; please refer to API documentations for ReferenceIntersector:

"....the view and visibility settings on the input view will determine if a particular element is returned (for example, hidden elements will never be returned by this tool, nor will elements whose geometry is outside the section box of the view)."

 

If you think this question still exists, in order to explore this matter further, we will need to provide a minimal reproducible case for the development team to analyse in depth.
In order to understand exactly what you mean and be able to research possible reasons for the discrepancy between the observed and expected behaviour, they require:
· A short exact description of what you are trying to achieve.
· The behavior you observe versus what you expect, and why this is a problem.
· A complete yet minimal Revit sample model to run a test in.
· A complete yet minimal macro embedded in the sample model or Visual Studio solution with add-in manifest that can be compiled, loaded, run and debugged with a single click to analyse its behavior live in the sample model.
· Detailed step-by-step instructions for reproducing the issue, e.g. which element to pick, what command to launch etc.
· http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

 

 


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi Jim - Thank you for your reply. I am working with Jeff the OP on this toolset. Attached is a Screencast to show how the insulation is not being recognized but the pipe is. I will get with Jeff to provide what was requested. Thank You

 

https://knowledge.autodesk.com/community/screencast/cabd655f-cdc5-4f9d-92fb-25acf4d94b11 

0 Likes
Message 4 of 5

JeffYao28
Enthusiast
Enthusiast

Dear Jim,

 

Thank you much for your prompt response!

I'm trying to detect from a given point goes upward, if a fabrication part's insulation can be found.

Please find attached the RVT file and Visual Studio 2017 solution files. There're 2 points hard coded in the source code, the first one is underneath the duct body, the second one is underneath the insulation. Ideally, both method calls should return something not null. But right now, as I tested with Revit 2018.3 and Revit 2019.1, only the first one returned non-null.

The RVT file attached is saved by Revit 2019.1.

You can test by picking any other points from underneath the insulation.

 

Your help is appreciated!

 

Jeff Yao

0 Likes
Message 5 of 5

JimJia
Alumni
Alumni

Hi JeffYao,

     I created a duct (Height:305mm, Width:305mm) with 25mm insulation thickness in Revit 2018 accroding to your attachment, and codes as below:

var doc = commandData.Application.ActiveUIDocument.Document;
var referenceIntersector = new ReferenceIntersector(new ElementIsElementTypeFilter(true),FindReferenceTarget.All, (View3D)commandData.Application.ActiveUIDocument.ActiveView);
var refInContextlist = referenceIntersector.Find(new XYZ(0, 0, 0), XYZ.BasisZ);

 I found six data in refInContextlist:
    1. Proximity = 9.34219160104987
    2. Proximity = 10.342847769028872
    3. Proximity = 9.34219160104987
    4. Proximity = 10.4248687664042
    5. Proximity = 9.26017060367454
    6. Proximity = 9.26017060367454
so:
    (9.34219160104987-9.26017060367454)*304.8 = 25mm.

It means insulation in FabricationPart could get intersected through ReferenceIntersect.
I advise that you could use Find() function not FindNearest() function to find project point in insulation. I will inform Revit team to investigate why the closest data is not in the first place.

Wish it is helpful for you 🙂

Best Regards
Jim Jia


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes