Message 1 of 3

Not applicable
05-20-2016
03:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everybody,
I am here maybe with a stupid question,
I am trying to create an electrical circuit via the revit API. I have see that there are not many examples on how to do it.
I have seen in the revit API help the referece to the "NewElectricalSystem" Method (http://revitapisearch.com/html/654da57c-4209-f64d-5f4f-8635c4708f98.htm) and I am trying to do it with the next code:
FamilyInstance eLoad = doc.GetElement(subCompId) as FamilyInstance;
ConnectorSet cS = eLoad.MEPModel.ConnectorManager.Connectors;
foreach(Connector c in cS)
{
ElectricalSystem nES = Autodesk.Revit.Creation.Document.NewElectricalSystem(c,ElectricalSystemType.PowerCircuit);
}
}
It seems easy, but unfortunately y get the next error:
An object reference is required for the non-static field, method, or property 'Autodesk.Revit.Creation.Document.NewElectricalSystem(Autodesk.Revit.DB.Connector, Autodesk.Revit.DB.Electrical.ElectricalSystemType)' (CS0120)
And I have no idea on how do i have to proceed in order to fix it.
Can anyone give any help??
many tanks in advance!
Solved! Go to Solution.