Message 1 of 3
How to connect conduit with fittings?

Not applicable
07-13-2021
02:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I have created conduit element between the box and the conduit elbow, but I had a problem with conduit connection - by default it is not connected with elbow fitting
I know about connector1.ConnectTo(connector2) method, but there is the problem with obtaining connectors from my conduit. How can I make connection between elbow and conduit with API?
//GETTING CONNECTORS FROM ELBOWS
IList<Connector> connectors = new List<Connector>();
foreach (Element elb in elbows)
{
if ((elb as FamilyInstance).MEPModel.ConnectorManager != null)
{
foreach (Connector con in (elb as
FamilyInstance).MEPModel.ConnectorManager.
Connectors.Cast<Connector>())
{
connectors.Add(con);
}
}
}
//CREATE CONDUITS
//points.OrderByDescending(x => x.X).Last() - intersection point with box
//curve.GetEndPoint(0) - start point (equals to elbow's connector origin)
Conduit first = Conduit.Create(doc, type, curve.GetEndPoint(0),
points.OrderByDescending(x => x.X).Last(), conduit.LevelId);
//TRYING TO MAKE CONNECTION
foreach (Connector c in connectors)
{
if (c.Origin.IsAlmostEqualTo((first.Location as
LocationCurve).Curve.GetEndPoint(0)))
{
//CONNECTOR'S ORIGIN EQUALS TO CONDUIT'S CURVE START
}
else if (c.Origin.IsAlmostEqualTo((first.Location as
LocationCurve).Curve.GetEndPoint(1)))
{
//CONNECTOR'S ORIGIN EQUALS TO CONDUIT'S CURVE END
}
}