Disconnect connector from adjacent fitting

Disconnect connector from adjacent fitting

Anonymous
Not applicable
1,406 Views
2 Replies
Message 1 of 3

Disconnect connector from adjacent fitting

Anonymous
Not applicable

I am attempting to split a duct in two which is a topic that has been covered on this forum before, a good solution appears to be suggested here: http://forums.autodesk.com/t5/revit-api-forum/pipe-duck-spliting-using-the-revit-api/m-p/3312303/hig...

 

The first step is to disconnect the pipe or duct from any fittings that might be attached at the end to be shortened, this is where I am struggling.

 

I can grab the connector no problem and it looks like connector1.DisconnectFrom(connector2) should do the trick but I am not able to find the relevant connector2 to disconnect from. I have tried connector1.GetMEPConnectorInfo().LinkedConnector but that returns null even when connector.IsConnected returns true.

 

Could anyone point me in the direction of a method to obtain the connector(s) which are connected to a given connector?

0 Likes
Accepted solutions (1)
1,407 Views
2 Replies
Replies (2)
Message 2 of 3

matthew_taylor
Advisor
Advisor
Accepted solution

Hi Darren,

If you're using 2017, then BreakCurve looks like what you need: http://www.revitapidocs.com/2017/baeec9be-b43d-d378-31b9-453432d44bfb.htm

 

If the duct you are trying to get connector info from was created in the same macro, you may need to either start a new transaction or do a doc.regenerate in order to receive fresh data.

 

There is an example of how to find a connected element here: http://www.revitapidocs.com/2017/11e07082-b3f2-26a1-de79-16535f44716c.htm

 

Does that help?

 

-Matt


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
Message 3 of 3

Anonymous
Not applicable

Thanks Matt, the connector.AllRefs method in the example you linked has done the trick for me!

 

BreakCurve sounds fantastic but at this stage I need target 2016.

0 Likes