Revit API

Reply
Member
sppeeddyy
Posts: 3
Registered: ‎01-31-2012
Message 1 of 5 (761 Views)

Pipe / Duck spliting using the Revit API

761 Views, 4 Replies
01-31-2012 06:19 AM

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.

Mentor
ollikat
Posts: 165
Registered: ‎04-01-2011
Message 2 of 5 (747 Views)

Re: Pipe / Duck spliting using the Revit API

02-01-2012 10:09 PM 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.

Member
sppeeddyy
Posts: 3
Registered: ‎01-31-2012
Message 3 of 5 (741 Views)

Re: Pipe / Duck spliting using the Revit API

02-02-2012 08:08 AM 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!

Mentor
ollikat
Posts: 165
Registered: ‎04-01-2011
Message 4 of 5 (735 Views)

Re: Pipe / Duck spliting using the Revit API

02-02-2012 10:36 PM 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.

Member
sppeeddyy
Posts: 3
Registered: ‎01-31-2012
Message 5 of 5 (722 Views)

Re: Pipe / Duck spliting using the Revit API

02-07-2012 02:54 PM 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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.