pipe end point Elements

pipe end point Elements

Anonymous
Not applicable
1,281 Views
3 Replies
Message 1 of 4

pipe end point Elements

Anonymous
Not applicable

Dear Forum Members

 

I need to find out all pipes whose end points are not connected to anything. I can find out the pipes end point LocationCurve but I need to check that the pipes endpoint is connected to some element or not.

 

Thanks & Regards

 

0 Likes
Accepted solutions (1)
1,282 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

Dear Sanjaymann,

 

Just googling for it should give you more than enough information, e.g.

 

http://lmgtfy.com/?q=building+coder+mep+pipe+connected

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 4

Anonymous
Not applicable

That was so sweet of you to google that for me.

I try to make sure that if after reading the api and then googling on the topic I don't find a solution then I post it on the forum.

 

Let me rephrase:

 

In Revit 2014 there is a functionality to cap open ended pipes. Similiar to that I want to write a code to find open ended pipes but my target version is 2013.

 

I hope I was able to make understand the scenario.

 

Thanks & Regards

 

0 Likes
Message 4 of 4

Anonymous
Not applicable
Accepted solution

Dear members,

The following code solved it:

 

foreach (Pipe pp in new FilteredElementCollector(Command.doc).OfClass(typeof(Pipe)))
{
  foreach (Connector c in pp.ConnectorManager.Connectors)
   { 

     if (c.IsConnected == true)
     {
       MessageBox.Show("Closed End");

     }
   else
    {
     MessageBox.Show("Open End");

    }

  }

}