Dynamo script causes families instance parameter to become read only

Hi right now I’m trying to use a dynamo node/python script to circuit electrical devices, the problem I’m having is the script causes my electrical devices voltage parameter from the electrical connector to set to zero and become ready only. The only way I’ve found around this problem is to edit my parameters voltage from instance to a type parameter which prevents the parameter from resetting to zero and becoming read only, but I really need my families voltage parameter to be an instance parameter or else it seriously complicates the work flow I was trying to achieve does anyone have any ideas how to fix this? I posted the nodes code below and a link to the dynamo forum discussion where the python code was developed any advice on solving this is welcome please.

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

clr.AddReference(‘RevitServices’)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *

clr.AddReference(‘RevitNodes’)
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference(‘RevitAPI’)
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Electrical import *
from Autodesk.Revit.DB import MEPSystem

clr.AddReference(‘DSCoreNodes’)
import DSCore
from DSCore.List import *

import sys
pyt_path = r’C:\Program Files (x86)\IronPython 2.7\Lib’
sys.path.append(pyt_path)

/# Import List ( ICollection(ElementId) = ListElementId )
clr.AddReference(“System”)
from System.Collections.Generic import List

def tolist(obj):
if isinstance(obj, list):
return UnwrapElement(obj)
else:
return [UnwrapElement(obj)]

#The inputs to this node will be stored as a list in the IN variables.
input = tolist(IN[0])

electComponents = ListElementId

for i in input:
electComponents.Add(i.Id)

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

C=0

OUT=
TransactionManager.Instance.EnsureInTransaction(doc)

for i in electComponents:
b=electComponents[C]
bb=tolist(b)
newcircuit = ElectricalSystem.Create(doc, bb, ElectricalSystemType.PowerCircuit)
C+=1
OUT.append(newcircuit)

TransactionManager.Instance.TransactionTaskDone()

I’m actually having the same issue right now. I don’t think it’s currently possible. Number of poles and voltage seem to conflict with each other and I haven’t seen a method that allows you to assign them when creating the system.

It would also be nice if you could paste your code as preformatted text </>.

Hi not sure if this moves either of us any closer to a solution, but I’ve found that if you associate/create a global parameter with your voltage parameter value 120V, 208V that script won’t reset the value to zero if you wanted to change the voltage though if you don’t have a global parameter created for 480V for example you’d have to uncircuit and create a global parameter for it with that value not at all a convenient solution though and not much better than making voltage a type parameter