Replicate "Connect To" MEP button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone, I've reviewed the forum and haven't found the exact case I want to discuss.
I'm trying to replicate the 'Connect To' button using the Revit API. For example, if we have a duct and a grille nearby, when I select the grille, click 'Connect To', and then select the duct, it automatically draws a small section of duct that connects the grille and the duct perpendicularly. This can only be done one at a time, so I want to create a script that allows you to select a group of grilles and have them all connect to the same duct.
Initially, I thought that if something can be done in Revit, it can be done with the API, but I already found out that’s not the case when it comes to splitting walls. So, it's possible this might not be feasible either, and I might need to find an alternative.
Before exploring other options, I've been researching the API and came across this method of MEPAnalyticalConnection Class:
public static ISet<ElementId> CreateMultipleConnections( Document doc, ElementId typeId, IList<Connector> equipmentOpenConnectors, IList<ElementId> curveIdsToConnect )
I've tried it, but I can't get it to work. Has anyone tested it before?
Thank you in advance.