Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Pipe / Duck spliting using the Revit API

4 REPLIES 4
Reply
Message 1 of 5
sppeeddyy
2690 Views, 4 Replies

Pipe / Duck spliting using the Revit API

Hi

 

I have a C# code that allows users to select a pipe or a duct and can retrieve the lenght property from it. Since I am new to Revit API, I was wondering is there a way to spilt a pipe/duct into specified length. For example, if I have a 50" pipe, I need to split it into 5 pipes of 10" each.

 

I would greatly appreciate any input. Thanks in advance.

4 REPLIES 4
Message 2 of 5
ollikat
in reply to: sppeeddyy

As far as I know, there's no single method for doing the split in API. If you are going to do your own split method, you have to consider following steps

 

1. disconnect pipe/duct (curve) from the other end if connected

2. disconnect possible tap connections (and store them some how)

3. shorten the curve

4. Create new curve and place it correctly plus connect the other end if needed

5. set similar parameter values that was in original curve

6. reconnect the taps to correct curve

 

Optionally you can delete the old curve totally and create two new.

 

So as you can see, it's not the worlds simplest task to do and that's why I think it doesn't make sense to start copy-paste code here. So just go ahead and start coding 🙂 If you face some issues, let see if someone can help you with those.

Message 3 of 5
sppeeddyy
in reply to: ollikat

Thank you for your suggestion. I have started working on the steps you mentioned since it makes complete sense. However, I was wondering if there a way to create new pipe filter, eg. coupling, which is used in Revit to spilt a pipe? If I could somehow create a new pipe coupling then I can place it at a defined lenght on a pipe. If possible, kindly provide a sample code for creating a new coupling.

 

Please let me know your thoughts on this. Thank you!

Message 4 of 5
ollikat
in reply to: sppeeddyy

I wonder if you mean union? That's a good idea but unfortunatelly doesn't make our life easier. Union is created with Document::NewUnionFitting() method and it takes two connectors. So before you can install union, you have to have two ducts with open ends.

Message 5 of 5
sppeeddyy
in reply to: ollikat

Thanks! I am looking for a flang and union kind of deal. I would appreciate if someone could provide more explanation on union and flages and the best logic to accomplish it.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community