Values from the Electrical Settings

Another day, another challenge!

I ran into this roadblock . . . trying to set Distribution types for all transformers & panels. Turns out this isn’t something that can be filled in by a string. It’s actually controlled by Distribution Systems in the Electrical Settings.

Is there a way to access the values from this in a list, so that I can plug them in to set the parameter values in my various Electrical Equipment items?

Also. . . is there some sort of basic Python script I can use to try to modify to address this stuff myself? I can find the Revit API categories here: http://revitapisearch.com/html/4e94a9fd-aaec-b38b-5d67-edac1ed07d50.htm

. . . but I can’t do much with them. I need to install the developer kit for 2016, but I haven’t had time to figure out how to compile it yet.

Where do you all look to find the categories to type into a python script to access data via the Revit API?

You can use this for setting the distribution systems:

As for looking up API stuff you can also use the recently released http://www.revitapidocs.com/
You don’t need to install the developer kit to use the python nodes in Dynamo though.

1 Like

Thanks you for your help (again)!

Ok. . . . so this works, but only under an odd condition.

The first time I run it, Revit gives me an error saying that the Distribution System is invalid.

Then I freeze/unfreeze some nodes, reconnect some wires (basically make tiny, meaningless changes to the script), run it again, and . . . it works!

Great for me, but I can’t roll it out to my users. Has anyone else encountered something similar?

That’s weird, it’s working fine here.
Could you share some screens? What elements and Distribution Systems are you feeding into the “SetParameter” node?

I think it’s something odd with the transformer family. Either that, or the fact that some were already circuited, and they apparently (according to the elec eng that I’m working with) behave oddly if you try to change the Distribution System once they’re already circuited. I think that was what was giving me the error.

I set it up to work on Panels, Switchboards and Transformers. It works fine on the first two. It broke all of the distribution systems on the transformers, so I’m working on fixing that now -.-’. Win some lose some, eh? haha. (Typically I test these things on detached projects, but I was a little overconfident this time and used it on a live one.)

The code is attached - it’s too large to take snips of. DistributionSettings.dyn (70.7 KB)

Also, please note - the nodes are a mess b/c I was trying to decipher the problem, and just let it go after I realized it was taking up too much time.

It probably is something with the transformer family that you’ve mentioned as it is the only element that’s giving you trouble. I can imagine it has a lot of elements connected to it downstream so that might be a reason.
I tried changing some distribution systems myself after having assigned fixtures to them and it still worked, but my model is probably nothing near the scope as your model.

I appreciate you taking a look. Good to know that it works with other families that already have assigned distribution systems. This is for a fairly large project; it’s entirely possible that’s the cause.

At least it works! Just . . . not for the model I;m working on, lol.

Alright - I figured it out! The key was the node I was using to set the parameters. For whatever reason, it was only setting the parameter on one transformer. I used another node - Set One Parameter to Many Elements (from the LSJ package) - and that fixed it! No error message or anything!

Just thought I’d share in case someone ran into a similar problem.

1 Like