Could I get another FamilyInstance when using NewElbowFitting

Could I get another FamilyInstance when using NewElbowFitting

tristaVXAM4
Participant Participant
307 Views
3 Replies
Message 1 of 4

Could I get another FamilyInstance when using NewElbowFitting

tristaVXAM4
Participant
Participant

Hello,

 

There are two pipes with different diameters.

2025-11-10 13_28_54-.png

 

When I use "NewElbowFitting" to create fitting, revit would create two fittings.

2025-11-10 13_28_24-.png

But the "familyInstance" means the elbow, not both of them.
familyInstance = doc.Create.NewElbowFitting(conn1, conn2);

How to get the familyInstance of the other fitting?

 

Thank you.

0 Likes
Accepted solutions (1)
308 Views
3 Replies
Replies (3)
Message 2 of 4

ankofl
Advocate
Advocate

I think there is no built-in function, but you can go through the connectors of your tap and find the connected fitting of the transition through this.

0 Likes
Message 3 of 4

ctm_mka
Collaborator
Collaborator
Accepted solution

try subscribing to a Document changed event, its should give you the elementids of both objects each time a newelbow is created.

private void OnElemCreation(object sender, DocumentChangedEventArgs e) 
{
e.GetAddedElementIDs(); //should have all the element ids at time of creation
{
0 Likes
Message 4 of 4

tristaVXAM4
Participant
Participant

It works!!! Thank you~

0 Likes