How to create a SwitchSystem in Revit API?

How to create a SwitchSystem in Revit API?

mourajrn
Explorer Explorer
435 Views
3 Replies
Message 1 of 4

How to create a SwitchSystem in Revit API?

mourajrn
Explorer
Explorer

Hello, everyone,

 

I want to connect OST_LightingFixtures with OST_LightingDevices but I couldn't find a method for creating the system.

How can I create a SwitchSystem in Revit API using C#?

 

Thank you in advance.

436 Views
3 Replies
Replies (3)
Message 2 of 4

ricaun
Advisor
Advisor

You couldn't find it because there is no method to create a SwitchSystem using the Revit API.

 

...

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

Message 3 of 4

mourajrn
Explorer
Explorer
Thanks for the reply, Luiz.
I always watch your videos on YouTube. Congratulations on the content.
Is there any workaround for creating SwitchSystems? Or is it really impossible?
Message 4 of 4

ricaun
Advisor
Advisor

I tried PostableCommand but does not work, the only way I found is by clicking on the Switch button on the Create Systems ribbon using System.Windows.Automation.

 

ricaun_0-1682013830045.png

 

I did the same in Power to force open the Voltage/PhaseNumber UI selection.

 

I implemented the plugin ElectricalUtils to add a shortcut to make it easy to create circuits inside the shared family.

 

 

The only problem is that the plugin needs to wait for the Revit UI and then I could click on the button using Windows Automation, to wait for a DocumentChanged to get the Switch...
Everything works in an async way, which is kinda hard work...

 

Still waiting for Autodesk to add something like:

var switchSystem = MEPSystem.CreateSwitch(document, elements);

...

 

 

 

 

 

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils