We had an internal discussion on the relationship between the different API classes involved in defining connectors in Revit MEP which I thought might be of general interest as well.
Question: What is the difference between the Connector class versus the DuctConnector, PipeConnector and ElectricalConnector ones? I know one of them is used in the context of family documents only, and the other one is in project context. But what is the main difference between them?
Answer: In Revit MEP, we work with different groups of elements, which all live in the project file, such as:
- Equipment
- Pipe and duct
- Fitting
Fittings and equipment are family instances, pipes and ducts are defined internally in Revit. They connect to their neighbour elements using connectors. The connectors are not elements, nor family instances, and do not live in the project file. They are contained within the family instances. Therefore, they have to be added to the family definition.
There are different types of connectors for the different types of systems. A single piece of MEP equipment can have none, some or all connector types.
For instance, a piece of HVAC equipment such as a cooler may have electrical connections for power, pipes for cooling water in- and outlets, and ducts for air in- and outlets. All these connectors are defined in the family editor. When the equipment is inserted into the model, the connectors are used to hook it up to neighbouring elements, in this case electrical system, pipes and ducts.
We thus have one set of classes for defining connectors, which reside in the family document. We have another class to represent the connectors on the resulting family instances, once they have been inserted into a project document. The former are the DuctConnector, PipeConnector and ElectricalConnector classes, the latter the Connector class.
The API documentation says the following about the DuctConnector class: "This element type is accessible only in Autodesk Revit MEP family documents. Duct connectors that are accessible in MEP project documents are not elements, and are represented by Autodesk::Revit::MEP::Connector."
In the documentation on the Connector class, it says: "This connector is an item that is a part of another element (duct, pipe, fitting, or equipment). This connector does not represent the connector element that can be created inside a family; for that element, please refer to Revit::MEP::DuctConnector, Revit::MEP::PipeConnector and Revit::MEP::ElectricalConnector."
So, when you are inside a family document, building your equipment, you add a DuctConnector class to the model. This is then transformed into some information on the equipment hosting it. When you insert that equipment into the model and query it for its connectors, it returns Connector instances to you.
Here are the results of looking at the situation in the Revit user interface and RvtMgdDbg:
DuctConnector, PipeConnector and ElectricalConnector are the classes you see and use in the family editor. These objects are the MEP connector definition classes used as a part of the building blocks to define an MEP part:
Once you define a family type and insert it in a Revit project, you have a family instance, for instance this air handler:
This instance contains connectors, which are managed by the connection manager and represented by the Connector class:
Autodesk Structural Engineering Partner Program
Autodesk announced a Structural Engineering Partner Program to establish a framework for participating structural analysis software partners to engage and collaborate with Autodesk in delivering solutions for the field of structural engineering. Here are the links to the partner site and the partner guide.
Offspring Activities
My son Christopher started blogging as well, and posted his first film, though completely unrelated to Revit, or CAD, or computers, of course.