How to detect the orientation of pipe fittings connected to the pipe?

How to detect the orientation of pipe fittings connected to the pipe?

Anonymous
Not applicable
584 Views
2 Replies
Message 1 of 3

How to detect the orientation of pipe fittings connected to the pipe?

Anonymous
Not applicable

input.JPG

 

Hi as shown in the above graphics, i have to find the orientation of the pipe fittings and the distance between the start point.

Can anyone suggest me how to do this using revit API?

 

Thank you in advance.

 

0 Likes
585 Views
2 Replies
Replies (2)
Message 2 of 3

augusto.goncalves
Alumni
Alumni
At this blog post (http://adndevblog.typepad.com/aec/2014/12/revitapi-align-2-pipes-through-center-lines.html), you'll find the following code that might help

private static Line GetCenterline(Pipe pipe)
{
Options options = new Options();
options.ComputeReferences = true; //!!!
options.IncludeNonVisibleObjects = true; //!!!
if (pipe.Document.ActiveView != null)
options.View = pipe.Document.ActiveView;
else
options.DetailLevel = ViewDetailLevel.Fine;

var geoElem = pipe.get_Geometry(options);
foreach (var item in geoElem)
{
Line lineObj = item as Line;
if (lineObj != null)
{
return lineObj;
}
}
return null;
}
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi Can anyone please tell me how to detect the orientation of the pipe fittings which are connected to pipe as show in the above image?

0 Likes