API - can't keep elements joined

API - can't keep elements joined

RECArchi
Collaborator Collaborator
979 Views
5 Replies
Message 1 of 6

API - can't keep elements joined

RECArchi
Collaborator
Collaborator

Hi,

Using API, when I cut a solid with a void, I have no problem if the solid has flat sketch (on 0XY plane).

However, as soon as there are slopes, sometimes (not always) revit can't cut geometry. I get the message "Revit can't keep elements joined". See attached family, solid can't be cut.

Is there a trick to be implemented on a code wich could avoid this message and manage to cut solids regardless of the shape of solids ?

I want a general solution to implement on a code, not a solution to the specific family I attached.

Thank you in advance.

Sincerely.

0 Likes
980 Views
5 Replies
Replies (5)
Message 2 of 6

homer_anave
Contributor
Contributor

Hi there.


Looking at the family you attached, it seems that the void was not properly created to cut through the solid form.

The void form you created does not pass through the solid, hence the error.
As you may know, Revit is not built to process complex geometry modifications unlike 3ds Max and Inventor.
In this case, you must either pass the void through the solid so that the void will cut through the solid properly.

If this can be done with just Revit modeling, so can the API.

0 Likes
Message 3 of 6

RECArchi
Collaborator
Collaborator

Hi,

Thank you for your reply @homer_anave .

Theoretically (mathematically), the void you show on cutsolid3.png should pass through the solid.

It works most of the time, but sometimes Revit creates very slight offsets between solid and void. As you mention, complex geometry might be the cause.

Anyway, I will "cheat" by slightly increase profils surfaces and lengths of the path of the void. I hope it will help to avoid this issue.

Sincerely.

0 Likes
Message 4 of 6

RECArchi
Collaborator
Collaborator

Hi @homer_anave ,

As you can see on the attached file, the void passes through the solid. However, it can't cut it 😞 . Do you know why ?

Thank you.

0 Likes
Message 5 of 6

RECArchi
Collaborator
Collaborator

Another question : Is-it possible to skip warnings and error messages by chosing which choice I want to use ("OK" and "Detach") ?

Thank you in advance.

Sincerely.

0 Likes
Message 6 of 6

homer_anave
Contributor
Contributor

Hi, RECArchi,

 

It is possible, by using the Failures API.

There are lots of classes that are associated with Failures API so it is better to look at the samples offered by Jeremy Tammik from his blog. As of this writing, he has just posted a new post regarding this. Please check it out, among others.

 

The Building Coder: Revit 2023 API Docs and Disabling an Error Failure (typepad.com)

0 Likes