How to reconnect the broken pipes in Revit API

How to reconnect the broken pipes in Revit API

Anonymous
Not applicable
1,019 Views
2 Replies
Message 1 of 3

How to reconnect the broken pipes in Revit API

Anonymous
Not applicable

In order to create a tee fitting between two pipes (pipe1 & pipe2), i broke a pipe (lets say pipe1) into two pipes (pipe1 & brokenPipe) using BreakCurve method in API. When i try to create tee fitting with these 3 pipes (pipe1, pipe2 & brokenPipe), in some cases the tee fitting is not created due to lack of clearance (already a tee fitting is present closer to current one for a different set of pipes).

aravindmechbala_1-1598011962923.png

 

So, now that tee fitting is not created i want those two pipes (pipe1 & brokenPipe) to be joined as pipe1 which i had before pipe break.

 

I tried connector1.ConnectTo(connector2), but its not working. Can someone help me?

0 Likes
1,020 Views
2 Replies
Replies (2)
Message 2 of 3

ollikat
Collaborator
Collaborator

One question and one suggestion for you.

"It's not working"
Could you please explain in more detail, how exactly it is not working? Do you get any error, or is some API method returning false, or what? Obviously the pipes doesn't get connected I assume. Are those connectors located near to each other? I think they should probably.

One work around could be to use transaction rollback. I mean, instead of using additional code to reconnect, you could simply rollback the transaction where you have broke the pipe. I know can be sometimes hard to deal with the transactions in the code, but at least you should try it. And as a tip, if you think you cannot know whether the T-fitting creation fails without commit, you could try whether the Document.Regenerate() would be sufficient instead.

 

Hope these help.

0 Likes
Message 3 of 3

ollikat
Collaborator
Collaborator

Hi again.

I just got more accurate information from my colleague.

You have actually observed a known feature of Revit API functionality when connecting two end connectors of ducts/pipes etc. It will NOT join the pipes as one.

There has been a trick/work around where you place an union fitting between those pipes, and then remove it. The Revit will then automatically join those pipes. But this doesn't work anymore with Revit 2021. Please see the following forum thread:

https://forums.autodesk.com/t5/revit-api-forum/delete-connected-union-fitting-doesn-t-automatically-...

 

Hope this helps.

0 Likes