Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

find colliding Elements in the document und cut them out of the current element

Anonymous

find colliding Elements in the document und cut them out of the current element

Anonymous
Not applicable

Hello everyone,

 

I think my Problem is simple and my Solution is close to the final one:

 

I have a given set of elements and in there there are some that are allowed to be cut and some that i want to keep as they are.

 

So the elements that are allowed to be cut by others are given by their ElementId and i already have them in a List.

 

My function takes one Element of that list, finds all other Elements that are overlapping it and then cuts them out.

 

therefor i use the two funtions:

JoinGeometryUtils.GetJoinedElements(m_doc, eleToBeCut);

and

  SolidSolidCutUtils.AddCutBetweenSolids(m_doc, eleToBeCut, elemInJoin);

 

Function (ElementId eleToBeCut)
ICollection<ElementId> ListOfElements = JoinGeometryUtils.GetJoinedElements(m_doc, eleToBeCut); foreach (var Elementid in ListOfElements) { Element elementInJoin = m_doc.GetElement(Elementid); // JoinGeometryUtils.UnjoinGeometry(m_doc, eleToBeCut, elemInJoin); SolidSolidCutUtils.AddCutBetweenSolids(m_doc, eleToBeCut, elemInJoin); }

 the Problem is that i get a lot of error messages that a Geometry that is already in Join can not be cut....

So far i  know that a cut in Revit is interpreted as a Join so if i have an Element that overlaps with multiple others i can only cut one of them out then my Element to be cut is in a JOIN.

 

But if i use

JoinGeometryUtils.UnjoinGeometry(m_doc, eleToBeCut, elemInJoin)

to get rid of the first join the Cutting is also reversed and i have not the result i was looking for.

 

Has anyone an idea what kind of cutting function i should use in my szenario to get a valid Solution.

for more information all my Elements are of type Adaptive family or one point family and they are all in the same contianer in the tree of the Project browser.

 

Thanks for your response.

 

Moritz

 

0 Likes
Reply
376 Views
0 Replies
Replies (0)