Linked File Element Intersection Solid Geometry

Linked File Element Intersection Solid Geometry

Anonymous
Not applicable
3,988 Views
11 Replies
Message 1 of 12

Linked File Element Intersection Solid Geometry

Anonymous
Not applicable

Hi All,

 

I have an element e1 with solid s1 and another element which is from linked Revit file/IFC file element e2 with sold s2.

 

While i am using element intersection filter element e1 return e2 as intersected element so i want to get intersection solid to calculated intersection area.

 

i used 

 

Solid intersection = BooleanOperationsUtils.ExecuteBooleanOperation(solidA, solidB, BooleanOperationsType.Intersect);

 

This not return intersection solid. 

 

 

Summary as below:

 

Element e1 = Document A

Solid     s1= Document A for element e1

 

Element e2 = Linked Document element in Document A

Solid     s2= Linked Document element in Document A for element e2

 

Step 1: Filter intersected element for e1 
             result give e2.

Step 2: Perform BooleanOperation to get intersected solid.
             result null.

 

 

 

 

Any help appreciated.

 

 

0 Likes
Accepted solutions (1)
3,989 Views
11 Replies
Replies (11)
Message 2 of 12

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Manish Singh,

 

You could address this as follows:

 

You have two solids, A in your main project P and B in your linked project Q.

 

  • Determine the transformation T from the linked document Q coordinates to P's.
  • Open the linked project Q and retrieve the solid Sb of B.
  • Transform it to P's coordinate space: T * Sb.
  • Retrieve the solid Sa of A.
  • Calculate the intersection of T*Sb with Sa.

 

Now you can use an element intersection filter based on the intersection result:

 

http://thebuildingcoder.typepad.com/blog/2018/03/create-2d-arc-and-filter-for-intersecting-elements....

 

The transformation of Sb can be obtained using the SolidUtils.CreateTransformed method:

 

http://www.revitapidocs.com/2018.1/22592761-f39c-4f53-d33b-6c21a4fa9d2d.htm

 

Please let us know whether it works and share a code snippet showing the final result.

 

Thank you!

 

Cheers,

 

Jeremy



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

Message 3 of 12

Anonymous
Not applicable

 

Hi Jeremy,

 

Thanks for reply. I tried as you said above.  please take a look shall i doing anything wrong because still i receive intersection surface area 0.

 

public static double GetIntersectedSolidArea(Document _host, Solid _hostElement, RevitLinkInstance _rins, Solid _linkedElement)
{

//Step 1 "Determine the transformation T from the linked document Q coordinates to P's."

Transform _transForm = _rins.GetTransform();

// Step 2 "Open the linked project Q and retrieve the solid Sb of B."

// _linkedElement is Solid of linked Link

// Step 3 "Transform it to P's coordinate space: T * Sb."

Solid _tmp = SolidUtils.CreateTransformed(_linkedElement, _transForm);

// Step 4 "Retrieve the solid Sa of A"
// _hostElement is hostElementSolid


Solid result= BooleanOperationsUtils.ExecuteBooleanOperation(_hostElement, _tmp, BooleanOperationsType.Intersect);


return result.SurfaceArea;

 

}

 

0 Likes
Message 4 of 12

jeremytammik
Autodesk
Autodesk

Dear Manish,

 

As a next step, it will help if you can visualise what you are doing.

 

A big help is to create model lines representing the solid edges, e.g., as described here to debug form creation or display a debugging point:

 

http://thebuildingcoder.typepad.com/blog/2009/07/debug-geometric-form-creation.html

 

http://thebuildingcoder.typepad.com/blog/2012/10/display-a-geometry-debugging-point-in-the-model.htm...

 

Then you can first verify that the transform really achieves what you expect it to.

 

Cheers,

 

Jeremy



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

0 Likes
Message 5 of 12

Anonymous
Not applicable

Hi Jeremy,

 

Again i wanted to say thanks for response. But still i am stuck at same point. I attached Code, Revit File & Manifest File. Please take a look what i did wrong so not able to get the exact result. This will help me lot. I am using revit 2018.

 

"Clash_Example_Project_r2017_Test.rvt" file is main file. 

 

For related element please see this pic.

Issue.JPG

0 Likes
Message 6 of 12

Anonymous
Not applicable
Hi Jeremy finally i got solution . there is only one change in my case have to use element transformation of linked element instead of Linked file.
0 Likes
Message 7 of 12

jeremytammik
Autodesk
Autodesk

Dear Manish,

 

Congratulations on solving this and thank you for letting us know!

 

Could you provide minimal code snippets before and after the fix you applied to demonstrate exactly what you mean, please?

 

I discussed a related issue in the meantime and am planning a blog post describing the solution for that case, which I thought would help you as well.

 

Now that you have solved it yourself I would love to add your issue to the same blog post.

 

Thank you!

 

Cheers,

 

Jeremy



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

0 Likes
Message 8 of 12

Anonymous
Not applicable
Hi Jeremy
Sure i will add solution with file within couple of days.
0 Likes
Message 9 of 12

jeremytammik
Autodesk
Autodesk

Here is the full description of another solution for a similar issue:

 

http://thebuildingcoder.typepad.com/blog/2018/04/using-intersection-filter-with-linked-file.html

 

However, it uses:

 

  Dim transform As Transform = linkedfile.GetTotalTransform

 

Cheers,

 

Jeremy



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

0 Likes
Message 10 of 12

c_hanschen
Advocate
Advocate

will you still share your solution?

 

thanks in advance.

 

chris

 

0 Likes
Message 11 of 12

BIM_S_S
Participant
Participant

I their any updates regarding sharing your code sample.

Because i have the same issue.

Thank You


@Anonymous wrote:
Hi Jeremy
Sure i will add solution with file within couple of days.

 

 

0 Likes
Message 12 of 12

BIM_S_S
Participant
Participant

I need to code sample in c# demonstrate how to detect intersection(clash) between  model  elements  in my files and elements in  linked file elements

0 Likes