Reference intersector to filter the pipe fitting objects

Reference intersector to filter the pipe fitting objects

Anonymous
Not applicable
662 Views
2 Replies
Message 1 of 3

Reference intersector to filter the pipe fitting objects

Anonymous
Not applicable

Hi,

 

I have pipe like as shown in below,

input1.JPG

 

While adding the coupling i have filter the branches/ pipe fittings/ Sprinklers which are connected to and i have give minimum distance between the couopling and the branches/ pipe fittings/ Sprinklers objects, and i have to calculate the distance from the start point.

 

I am trying with the below code, i am unabel to read the proper location of the pipe fittings,

Please help me to slove the issue.

 

ReferenceIntersector referenceIntersector = new ReferenceIntersector((View3D)m_document.ActiveView);
referenceIntersector.TargetType = FindReferenceTarget.Face;
IList<ReferenceWithContext> pipe_fitting_location = referenceIntersector.Find(strat,end);

foreach (ReferenceWithContext gRef in pipe_fitting_location)
{
   double proximity = gRef.Proximity;
   Reference pipe_fiitings = gRef.GetReference();
   TaskDialog.Show("ReferenceIntersector", pipe_fiitings.GlobalPoint.ToString());
}

 

Thank you in advance.

 

 

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

jeremytammik
Autodesk
Autodesk

Dear Anusha,

 

I do not understand what you want and what the problem is.

 

Why don't you just use the fitting location points?

 

Or the fitting connection points?

 

By the way, you can paste your code snippet using the 'Insert Code' button to make it more readable.

 

You could also use a spell checker to make your body text more readable  🙂

 

Cheers,

 

Jeremy



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

0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi Jeremy,

 

I am trying to split the pipe at some standard stock length (5000mm), and placing the coupling. While placing the as shown in the image the pipe may have branches/sprinklers connected to it. So I have to leave some min distance between the coupling and the branches/sprinklers while splitting.

So I am trying with the below code to filter the location of branches/sprinklers. But I am unable to read the proper location of the pipe fittings.

ReferenceIntersector referenceIntersector = new ReferenceIntersector((View3D)m_document.ActiveView);
referenceIntersector.TargetType = FindReferenceTarget.Face;
IList<ReferenceWithContext> pipe_fitting_location = referenceIntersector.Find(strat,end);

foreach (ReferenceWithContext gRef in pipe_fitting_location)
{
   double proximity = gRef.Proximity;
   Reference pipe_fiitings = gRef.GetReference();
   TaskDialog.Show("ReferenceIntersector", pipe_fiitings.GlobalPoint.ToString());
}

 

 

 

 

0 Likes