Get Load on Electrical Element (or, Get Parameter from Connector)

Get Load on Electrical Element (or, Get Parameter from Connector)

David_Robison
Advocate Advocate
2,916 Views
4 Replies
Message 1 of 5

Get Load on Electrical Element (or, Get Parameter from Connector)

David_Robison
Advocate
Advocate

I am trying to use the API to get the electrical load on a specific element in a Revit model.

 

Looking at a ConnectorElement in a Family document, I want to get the "Apparent Load" built-in parameters.

 

In the FamilyInstance, the ConnectorManager provides me with Connectors. These don't have parameters available on them.

 

Given a FamilyInstance and a Connector, what's the path to figure out the load on the Connector?

0 Likes
Accepted solutions (1)
2,917 Views
4 Replies
Replies (4)
Message 2 of 5

nathan.chapman
Collaborator
Collaborator

David-

Looking through the API doc i didn't see anything to get the apparent load.  There is a couple ways that should work.  The first is if you have a parameter driving the connectors loads you could just look up the parameter in the family to get the value.  Just remember that depending on how you have the family setup multiple pole family you will have to times the load by the number of phases.  Another thing would be is look at the Electrical Data parameter.  You will notice that the end of the string will contain the apparent power.   This will do the addition for you.  One tool that is a must if your diving into the Revit api is a Revit addin called RevitLookup.  It can be found here. https://github.com/jeremytammik/RevitLookup.  

Capture.PNG

 

Nate

 

Nathan Chapman
Production Manager at General Heating and Air Conditioning

Revit Architecture Certified Professional
Revit MEP Mechanical Certified Professional
Revit MEP Electrical Certified Professional
DynaFabrication Package Author

Was this answer helpful? If so, please click the ACCEPT AS SOLUTION or the KUDOS button.
Message 3 of 5

JimJia
Alumni
Alumni
Hi David,
I agree with Nathan that the #1 way should be good solution:
- Gets FamilySymbol of FamilyInstance: FamilySymbol sym = doc.GetElement(FamilyInstance.GetTypeId()) as FamilySymbol
- Edit the Family of family symbol: Document famDoc = doc.EditFamily(sym.Family);
- Filter the ConnectorElement from family document
- Use ConnectorElement.LookupParameter("Apparent Load")

Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
Message 4 of 5

David_Robison
Advocate
Advocate

Note for anyone else trying this solution: it works as long as you are not in a transaction. If you are in a transaction, you cannot use the "EditFamily" method. You will need to find and cache all the loads you might need before you start your transaction.

Message 5 of 5

David_Robison
Advocate
Advocate
Accepted solution

The API was updated in Revit 2017 to allow you to get these values during a transaction. See this post for a code sample:

https://forums.autodesk.com/t5/revit-api-forum/getting-electrical-load-information-from-in-place-fam...