How to get the data of an electrical connector

Hello everyone,

I’m trying to integrate elements from linked files (HVAC model) into my electrical model or into my electrical circuits in the model. This requires elements with electrical connections. Since linked elements can’t simply be integrated, a workaround is needed.

My idea is to copy the elements from the linked model into my model (so that they come with the electrical connection) and then integrate them into my circuit.

If the elements of the linked model changes (position and electrical data information), I would like to incorporate this into my model and update it.

Updating the position is not a problem. However, the situation is different with the electrical data of the connectors.

I’ve already read many forums and posts and have come to the conclusion that this doesn’t work with DynamoNodes, but that the data may only be accessible via the Revit API. I’m not particularly familiar with the Revit API yet (but I’m working on it :blush:).

Is there a general way to get the electrical data of a connector and to write it back?

And if so, does this also work for linked elements? (Otherwise, I’ll have to find a workaround here as well.)

I know, that it is possible to create family/shared parameter and control those parameters of the connector, but that assume that all families have it…. in practice thats not the case and to do that, I need to adjust all families …dont want to :smiley:

Maybe someone can help or enlighten me a bit :blush:

Thanks!

I’ll try to answer what I think are the important questions related to your process. It sounds like you’ll be aware of some of this already, but I think it’s important to lay it all out.

Reading and writing connector data are both possible but very different processes. As you’ve shown in your screenshot, connector data is typically controlled by related family parameters. Reading that data is simple because you can pull it directly from the connector itself. Writing that data means that you have to write to the family parameter. This is easy if you already know which parameters drive the connector properties. Otherwise, you have to identify the parameter relationships within the family editor for every family that you interact with.

How you handle this will be dependent on whether you can count on the electrical parameters always being the same for every electrical connector or not. If you can, then it’s really just a read/write of parameters. If you can’t, then you probably need a different process. An alternative to updating parameters would just be to delete and re-copy the linked instance. You’d obviously have to manage your circuits then, but that should be easier than managing individual parameter mappings to connector properties.

Also, the MEPover package does have nodes for reading connector data if you want to use that as a starting point. I don’t know of any packages with the ability to write to connectors for all the reasons mentioned above.

Hi Nick,

Thank you for the answer. Unfortunately, none of the Dynamonodes I’ve found offer a suitable solution.
For me, the question is whether or not the connector parameters can be accessed in general. My research has so far found built-in parameters. My attempt to read them using ChatGPT via the Revit API has been unsuccessful so far.

Perhaps the Revit API experts can help me figure out whether and how the connector parameters can be accessed.

Thank you very much

Yeah guess we can read them as Nick mention and we can write to them from a project this way here..Can I text or modify Connector description? - #2 by sovitek can probably help…not sure

Hi,

we can use GetMEPConnectorInfo() method, directly in the project

# Load the Python Standard and DesignScript Libraries
import sys
import clr
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
#import specify namespace
from Autodesk.Revit.DB.Electrical import *
from Autodesk.Revit.DB.Structure import *

#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

out = []
elem = UnwrapElement(IN[0])
if elem.MEPModel.ConnectorManager is not None:
    connectset = elem.MEPModel.ConnectorManager.Connectors
    data_connectors = []
    for con in connectset:
        if con.Domain == Domain.DomainElectrical:
            if "Power" in System.Enum.GetName(ElectricalSystemType, con.ElectricalSystemType):
                mepConnectorInfo = con.GetMEPConnectorInfo()
                # Description
                data_connectors.append(f"➤ Connector Elec. Type : {con.ElectricalSystemType.ToString()} - Description : {con.Description}") 
                # RBS_ELEC_POWER_FACTOR
                paravalue_PF = mepConnectorInfo.GetConnectorParameterValue(ElementId(BuiltInParameter.RBS_ELEC_POWER_FACTOR))
                value_PF = paravalue_PF.Value
                data_connectors.append(f"➤ Power Factor : {value_PF}")
                # RBS_ELEC_APPARENT_LOAD
                paravalue_loadApparent = mepConnectorInfo.GetConnectorParameterValue(ElementId(BuiltInParameter.RBS_ELEC_APPARENT_LOAD))                    
                value_loadApparent = UnitUtils.ConvertFromInternalUnits(paravalue_loadApparent.Value, UnitTypeId.VoltAmperes)
                data_connectors.append(f"➤ Load Apparent : {value_loadApparent:.2f} VA")
                
    out.append([elem, data_connectors])
    
OUT = out
1 Like

@c.poupin

Thanks for your input! Your code is the basis of what I tried to implement. With your code I was able to read voltage, power factor etc. …perfect :slight_smile:

You made my day - big Thanks !

Bests
Mark

1 Like