I work with Pipework, but I do the same and works fine, usually this issue is related to the list that feeds the "SetParameter" maybe needs to be flatten, or the number of values doesn't match the list of items.
First make sure the lists match at all levels, for instance a list with @L1, @L2 only won't match a list with @L1,@L2,@L3 even if they have the same number of element and they "look" in the same order, the "SetParameter" will read only only level and that can cause the issue.
* Use Levels
* Count the lists (match the counting)
* Flatten lists
* Use Watch nodes to see what is going on (and spot the list discrepancy)
Are you able to post the actual graph ?
nvm I just got the Dyn file, I'll give it a try
Follow Up:
Checking the graph, it seems like the node "SetDimensionValue" is intended to be used with a single value,
*******
if Cnt > 1:
for e in Inpt:
ItmDims = e.GetDimensions()
f.append(e.SetDimensionValue(ItmDims[DimName], DimValue))
*******
And you need to be able to add one value per item, I changed it just a bit, in order to get the next value each time (not very elegant, but I played safe, because I cannot test it (I have no Duct):
******
if Cnt > 1:
for e in Inpt:
ItmDims = e.GetDimensions()
f.append(e.SetDimensionValue(ItmDims[DimName], DimValue(index1)))
index1 = index1 + 1
******
So in brief:
Create a new "Python Script" node, press the plus sign twice so you have the same amount of inputs as the original node, and connect the lines in the same order,
IN[0] << Fabrication Parts
IN[1] << DimIndex
IN[2] << Dim Value
double click to open it delete all inside and once is clean paste the following code don't include the line of **** at the beginning and at the end:
***STAR***(after this line)
import clr
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import FabricationPart
from Autodesk.Revit.DB import FabricationDimensionDefinition
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
Inpt = UnwrapElement(IN[0])
Cnt = UnwrapElement(IN[1])
DimName = UnwrapElement(IN[2])
DimValue = UnwrapElement(IN[3])
f = list()
Doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(Doc)
index1 = 0
if Cnt > 1:
for e in Inpt:
ItmDims = e.GetDimensions()
f.append(e.SetDimensionValue(ItmDims[DimName], DimValue(index1)))
index1 = index1 + 1
else:
ItmDims = Inpt[0].GetDimensions()
f.append(Inpt[0].SetDimensionValue(ItmDims[DimName], DimValue))
TransactionManager.Instance.TransactionTaskDone()
OUT = f#Inpt, DimName, DimValue, ItmDims
***END***(before this line)
It is possible that instead of "DimValue(index1)" you need to use "DimeValue[index1]" but let's test it as it is first and let me know.