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: 

How to determine which SubComponent of an ElectricalEquipment a Conduit is connected to?

7 REPLIES 7
Reply
Message 1 of 8
mruth6N4TA
475 Views, 7 Replies

How to determine which SubComponent of an ElectricalEquipment a Conduit is connected to?

(I'm cross-posting this here and in the MEP forum, since I'm not sure which is the better place to get helpful replies)

 

We have the following issue (in Revit 2020):

We have a requirement to determine the connectivity between Conduits and Electrical equipments.

The latter are represented using FamilyInstances that contain a number of SubComponents that are also Electrical equipments.

 

In the example case, there are three conduits connected to different SubEquipments within the FamilyInstance.

Examining the MEPClass and the ConnectorManager, respectively, reveals that the Endpoints for all Conduits is the SuperComponent.

The MEPClass of the SubComponents are empty.

This means, there is no way to figure out which SubComponent each of the Conduits is connected to.

 

A workaround using the coordinates of the Conduit endpoints also doesn’t look promising

since neither the bounding boxes, nor the COG, nor the locations of the SubComponents provide an unambiguous match.

 

So, is there any way to find out which SubComponent of a FamilyInstance a Conduit is connected to?

 

I've uploaded a PDF containing a sequence of screenshots to show how this looks like in the RevitLookup plugin:

page 1: the Electrical Equipment SuperComponent

page 2: the three Electrical Equipment SubComponents

page 3: the (empty) MEPModel associated with the SubComponents

page 4: the MEPModel associated with the SuperComponent

page 5: the ConnectorManager associated with the SuperComponent

page 6: the 1st of the three Connectors associated with the SuperComponent

page 7: the 2nd of the three Connectors associated with the SuperComponent

page 8: the 3rd of the three Connectors associated with the SuperComponent

page 9: the Conduit that is the Owner of the 1st Connector

page 10: the Conduit that is the Owner of the 2nd Connector

page 11: the Conduit that is the Owner of the 3rd Connector

 

Please let me know if you require any additional information in order to help!

Labels (3)
7 REPLIES 7
Message 2 of 8
mhannonQ65N2
in reply to: mruth6N4TA

That's an interesting question.

 

My first suggestion would be to try setting the Description parameter of the connectors in the family editor of the subcomponents. Perhaps you could bind the connector's Description parameter to an instance parameter, you could call it Connector Description, of the subcomponent family. Then, in the SuperComponent family, you can set the Connector Description parameter of each subcomponent to a different value. I'm not sure what Revit does with the Description parameter but I know it can be accessed by the API.

Message 3 of 8
mruth6N4TA
in reply to: mhannonQ65N2

Thank you for the suggestion! This is actually quite close to the workaround we decided to implement while we wait if forum users (or Autodesk Support) come up with a better solution.

We decided to use the "Mark" parameter for this, but it isn't final, since we're still waiting for feedback from our customer, if the workaround is acceptable for them.
Message 4 of 8
RPTHOMAS108
in reply to: mruth6N4TA

MEP isn't my background but I would look to solve with ReferenceIntersector:

 

It appears the connector gives you:

Connector.CoordinateSystem (Z is normal to connector)

Connector.Origin

 

So if you start a nominal distance away from origin along the Z vector, point ray from that remote point back towards origin (opposite to Z vector). What is the first family instance you find from ReferenceIntersector.Find and is the Global point of result adequately near to the connector origin? You would have to see if normal of the connector is pointing outwards or inwards (I assume it would be outwards from equipment).

 

Also be aware of Connector.Angle (would assume this changes the Z vector anyway).

 

Out of interest is it common that a subcomponent would have it's own connectors? Is this a family authoring situation or do all connectors end up in the super component regardless? I thought the general idea of sub-components (nested shared family instances) was that they existed in the project as their own element records at top level but came in with super component.

Message 5 of 8
mruth6N4TA
in reply to: RPTHOMAS108

Thank you, that is an interesting idea. I'd definitely like to give it a try!

 

Message 6 of 8
jeremy_tammik
in reply to: mruth6N4TA

Dear mruth6N4TA,

 

Thank you for your update and your confidential sample model.

 

Congratulations on implementing the workaround using the Mark attribute to connect conduit to box. Many thanks to Matthew for that suggestion!

 

You add, Please ask the developers for a better approach. This is not a good workaround, because it could create bad errors.

 

Maybe Richard's suggestion to use the ReferenceIntersector instead is less error-prone?

 

Anyway, I am continuing to discuss this matter with the development team and hope that they can suggest a proper solution.

 

Best regards,

 

Jeremy

  

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

Dear mruth6N4TA,

 

The development team reply:

 

First:

  

By subComponent, do you mean a nested family?

 

If so, it is a known issue with MEP connectors that they do not support nested families.

 

One workaround is to place new connectors in the top-most family, as indicated in:

 

https://forums.autodesk.com/t5/revit-architecture-forum/nested-families-with-mep-connectors/td-p/572...

 

Second:

 

Why not start list of connected elements with the list of sub-components rather than the conduit?

 

It sounds as if they are starting with the conduit and working back to the sub-component which is how they are finding the main component. An alternative would be to start with the sub-component and progress to the conduit.

 

If not, proceeding to a geometry test may be the most immediate way forward: get all subcomponent geometry in the main component, find the distance from the connector’s point to each subcomponent; the closest should be the part in question.

 

The latter suggestion matches Richard's.

 

Best regards,

 

Jeremy

 

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

> By subComponent, do you mean a nested family?

I believe so, yes. From a programmer's viewpoint it looks like a FamilyInstance with SubComponents.

 

Thanks for the link to the known issue. I'll have to check with our client if creating the connectors in the top-most family would work with our usecase.

 

> Why not start list of connected elements with the list of sub-components rather than the conduit?

We're actually already checking connections from/to all types of Revit elements, i.e. electrical equipments, data devices, conduits, and conduit fittings.

 

As I've described and shown in the screenshots, the ConnectionManager comes up empty for connectors in SubComponents of a FamilyInstance, while the top-most Family's ConnectionManager shows them all.

 

I'll still have to check if the geometric solution suggested by Richard would work. I'm still waiting for feedback from our client.

 

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

Post to forums  

Autodesk Customer Advisory Groups


Rail Community