• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Revit API

    Reply
    Member
    sppeeddyy
    Posts: 3
    Registered: ‎01-31-2012

    Pipe / Duck spliting using the Revit API

    435 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.

    Please use plain text.
    Distinguished Contributor
    ollikat
    Posts: 104
    Registered: ‎04-01-2011

    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.

    Please use plain text.
    Member
    sppeeddyy
    Posts: 3
    Registered: ‎01-31-2012

    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!

    Please use plain text.
    Distinguished Contributor
    ollikat
    Posts: 104
    Registered: ‎04-01-2011

    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.

    Please use plain text.
    Member
    sppeeddyy
    Posts: 3
    Registered: ‎01-31-2012

    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.

    Please use plain text.