Failed to insert elbow

Failed to insert elbow

hakansupurkeci
Enthusiast Enthusiast
1,412 Views
12 Replies
Message 1 of 13

Failed to insert elbow

hakansupurkeci
Enthusiast
Enthusiast

Hi,

I am trying to draw this line in revit by retrieving pipe properties from a file.

failed.PNG

but i get this error when z axis changes,

I haven't found a solution yet as I can't find the cause of the error.

document.Create.NewElbowFitting(con1, con2);

0 Likes
1,413 Views
12 Replies
Replies (12)
Message 2 of 13

sahin.ikbal
Advocate
Advocate

@hakansupurkeci 

Make sure with manual trim first. Is that working as expected?


Some possible reasons for fail could be

i) Check if the the opposite site connector is not getting selected.
ii) In case the angle between them would come more than 90 degree then the join will fail.

iii)They probably are not intersecting with each other, check with manual trim if that is the case or not.

0 Likes
Message 3 of 13

hakansupurkeci
Enthusiast
Enthusiast

Thank you for your quick response,

 

I don't think it has anything to do with what you said.

Because I'm using the coordinates of the pre-existing channel and elbow.

0 Likes
Message 4 of 13

sahin.ikbal
Advocate
Advocate

@hakansupurkeci 
can you share the code you have used..

0 Likes
Message 5 of 13

hakansupurkeci
Enthusiast
Enthusiast

The "ducts" shown in the picture are in the "duct 2" sequence, respectively.

 

for (int i = 0; i < ducts2.Count() - 1; i++)
{
ConnectorSet duct_connectorSet1 = GetConnectors(ducts2[i]);
ConnectorSet duct_connectorSet2 = GetConnectors(ducts2[i + 1]);

Connector connector1 = null;
Connector connector2 = null;
double minDist = double.MaxValue;

foreach (Connector conn1 in duct_connectorSet1)
{
foreach (Connector conn2 in duct_connectorSet2)
{
double distance = conn1.Origin.DistanceTo(conn2.Origin);
if (distance < minDist)
{
connector1 = conn1;
connector2 = conn2;
minDist = distance;
}
}
}
try
{
document.Create.NewElbowFitting(connector1, connector2);
}
catch (Exception ex)
{
TaskDialog.Show("Duct Fitting ", ex.Message);
}
}

0 Likes
Message 6 of 13

sahin.ikbal
Advocate
Advocate

@hakansupurkeci 

I have replicated your code and its working fine with me without any exception.


Can you explain what do u mean by "i get this error when z axis changes".

Also draw a model line between both connectors before joining them for checking.

0 Likes
Message 7 of 13

hakansupurkeci
Enthusiast
Enthusiast

324561.PNG

In the image above I am using a different data and it renders the ducts properly,

I am using a different data in the image below, the elevation is changing and I am getting this error.

ele.PNG

0 Likes
Message 8 of 13

sahin.ikbal
Advocate
Advocate

Video.gif

 

It's working for xy plane to Z directed ducts.

0 Likes
Message 9 of 13

hakansupurkeci
Enthusiast
Enthusiast

Could it be a bug with the elbow I'm using?

0 Likes
Message 10 of 13

sahin.ikbal
Advocate
Advocate

"Could it be a bug with the elbow I'm using?"

Can't say for sure.

While working with similar jobs I have come across similar problems many times but every time I found something which I was doing wrong. Without the exact replica of the same its impossible to say the reason.
If only for that elbow its not working and for every other it is working than u can be confident as to this is a elbow family specific problem.

Message 11 of 13

hakansupurkeci
Enthusiast
Enthusiast

Got it, thank you for your time. I'm going to do some work on elbow.

0 Likes
Message 12 of 13

hakansupurkeci
Enthusiast
Enthusiast

I think the example you made is valid for the oval duct, I want to do this for the rectangular duct.

0 Likes
Message 13 of 13

sahin.ikbal
Advocate
Advocate

@hakansupurkeci 

For Rectangular 1st case is working but 2nd case is not also it should not be.

Check if your ducts are horizontally aligned.

Pic.png

0 Likes