Recently, I'm trying to build mep system using API in revit mep. When I try to create transition using Document.Create.newTransitionfitting() method, I get an unexpect result - there is a gap between transition fitting an duct. (See the picture below). Does anyone know how to fix this problem. Thanks !
fg1. before add transition fitting
fg2. with transition fitting
Solved! Go to Solution.
I think you just have to move the connector of the desired duct before creating the reducer. I you move it to same position than other duct's connector, I think API manages to shorten the duct correctly.
Thank you for your advice!
I try your method, but it didn't work for me, the gap still there.
Fortunatly, I fix this problem finily. Here is what I do.
First, create new transition fitting normaly.
///===================code I used======================
conn1 = ((DxfLine)bj.Line.Nodes[0].Linelist[0]).Conns[1]; //get the connector on one duct
conn2 = ((DxfLine)bj.Line.Nodes[1].Linelist[1]).Conns[0]; //get the connector on another duct
Fi = doc.Create.NewTransitionFitting(conn1, conn2); //Create a transition fitting using two connector
cs = Fi.MEPModel.ConnectorManager.Connectors; //get the connectors on new transition fitting
foreach (Connector c in cs)
{
if (c.Origin.DistanceTo(conn1.Origin) < 0.001)
{
if (!c.IsConnected) c.ConnectTo(conn1);
c.Width = conn1.Width; //set the width and the height of connector c
c.Height = conn1.Height;
}
else
{
if (!c.IsConnected) c.ConnectTo(conn2);
c.Width = conn2.Width;
c.Height = conn2.Height;
}
}
//=================end of create transition fitting=================
Then, commits current transaction, using Transaction.Commit() method.
Finily, set the Parameter("offset") of one connect on transition fitting to 0.0;
//==================code I use===============
conn2.Owner.get_Parameter("offset").Set(0.0);
//==================end==================
Here is the picture of the result. Gap seamed.
Great that you managed to get it work. Also very nice that you posted the solution here too...maybe it helps someone else in the future. Kudos form that 🙂