Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Connect pipes

10 REPLIES 10
Reply
Message 1 of 11
sanjaymann
2054 Views, 10 Replies

Connect pipes

Hi,

 

I want to connect two pipes similar to trim tool in revit.

 

How do I programatically call trim command. 

 

Thanks & Regards

10 REPLIES 10
Message 2 of 11
jeremytammik
in reply to: sanjaymann

Message 3 of 11
sanjaymann
in reply to: jeremytammik

Diidn't understand what was googled for me.

 

A simple question I have two pipes pipe1 and pipe2

 

Neither of them works successfully to connect two pies:

 

1. doc.Create.NewElbowFitting(c1end,c2start);

 

2.c1end.ConnectTo(c2start);

 

c1end is the connctor of pipe1 and c2start is the connector of pipe2

Message 4 of 11
jeremy_tammik
in reply to: sanjaymann

What happens if you connect them manually in the user interface?

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 5 of 11
sanjaymann
in reply to: jeremy_tammik

They simply get connected.

Message 6 of 11
jeremy_tammik
in reply to: sanjaymann

Good. Your solution 2. should produce the same result.

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 7 of 11
sanjaymann
in reply to: jeremy_tammik

No it does not.
Message 8 of 11
jeremy_tammik
in reply to: sanjaymann
Message 9 of 11
sanjaymann
in reply to: jeremy_tammik

The image below will clarify things:

Tried: 

try
{
c1end.ConnectTo(c2start);
Command.doc.Create.NewElbowFitting(c1end, c2start);

}
catch (Exception sdq)
{

 

MessageBox.Show(sdq.Message.ToString());
}

 

Tried Thsi:

try
{
Command.doc.Create.NewElbowFitting(c1end, c2start);

}
catch (Exception sdq)
{

 

MessageBox.Show(sdq.Message.ToString());
}

 

 

 tried this

 

 

try
{
c1end.ConnectTo(c2start);

}
catch (Exception sdq)
{

 

MessageBox.Show(sdq.Message.ToString());
}

 

But it creates the fittings between pipes in one place but not at the other.

 

pipes COnnection.png

 

 

 

 

Message 10 of 11
tknappEUVP8
in reply to: sanjaymann

Where you able to solve this at any point? I'm having the exact same problem and cannot find a solution. 

Message 11 of 11
Jes_Gonzalez
in reply to: sanjaymann

Any updated information on this would be greatly appreciated. I'm going down the same road.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community