Revit API Connect Ducts with fitting

Revit API Connect Ducts with fitting

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

Revit API Connect Ducts with fitting

Anonymous
Not applicable

Hello, I have 2 Ducts and I want to connect them with a fitting. Howcan I do that. I'am searching for that since a week but I couldn't find anything. 

I use this code to get the connectorset but I don't understand how to get the Connectors from it:

 

 public static ConnectorSet GetConnectors(Element element)
        {
            if (element == null) return null;
            FamilyInstance fi = element as FamilyInstance;
            if (fi != null && fi.MEPModel != null)
            {
               
                return fi.MEPModel.ConnectorManager.Connectors;
            }
            MEPSystem system = element as MEPSystem;
            if (system != null)
            {
                return system.ConnectorManager.Connectors;
            }

            MEPCurve duct = element as MEPCurve;
            if (duct != null)
            {
                return duct.ConnectorManager.Connectors;
            }
            return null;
        }

Can anyone provide me some help with that?

0 Likes
2,572 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

You need to hone your searching skills a bit.

 

Have you ever heard of Internet search engines?

 

https://duckduckgo.com/?q=revit+api+connect+duct+fitting

 

In addition, my own favourite place to go for this topic is the series of articles on creating a rolling offset:

 

http://thebuildingcoder.typepad.com/blog/2014/01/final-rolling-offset-using-pipecreate.html

 

It is for pipes, but the same also applies to ducts.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 3

Anonymous
Not applicable

Have you used Revit Lookup?

 

https://github.com/jeremytammik/RevitLookup

 

Browsing and testing this AddIn is invaluable if you're learning to develop in Revit.

 

 

 

 

0 Likes