Set value of family type parameters by name

i have created a list of type parameters in a revit family.
Like in this topic: Adding Multiple Parameters in the Family Editor

Now i try to set a list of values to the parameters.
Here is the list in the family:

and here is what i have:

But i get null with the “Family.SetParameterByName”-node from DanEDU
and i don’t know what i need to set for the element input for “Set Type Parameter”-node…
Any help would be great:)

EDIT: Im working in the family editor.

Why aren’t you using the regular Element.SetParameterByName node?

1 Like

well i don’t know what i need to select for the Element input, because my parameters are only in the Family.

EDIT: Im working in the family editor.

1 Like

Right, then, indeed, it does not work. You’re right.
Considering it’s a type, maybe try to use FamilyType.ByName node here to get the right type…
But frankly I do not really know.

The “Document.Current” node doesn’t provide a propper Autodesk document. That’s why I and others code the nodes taking the Revit API Autodesk Revit Documents. That’s also why you don’t need to feed the node with a current document, just leave the port unconnected and it will take the current document (see the help for the port default input).

@erfajo, thx for helping.
Now i left the input of document empty, but there is still something wrong.

Any other idea what could be wrong?

It must be a type problem, is it string values you use for parameters and is the values the propper type?

Next… remember if you use SI units, you have to convert them into those odd Imperial units that Revit is built upon! :-S

your right!
your node needs integer and i have double

Mh, well…but if i round the doubles…the values aren’t right

My node works with whatever parameter you use, it is you parameter that demands integers!

…and you need conversion…
in US they use this odd imperial system, and they spam the software we use with that…
angle by radians is also unknown for most users…

oh…i forgot this
but i have still an null value:

I have my length in m and my angles in degree. The angles are realy small. Like 3°.

Please add the needed files for testing. Something not expected must go wrong…

18_03_22_Forum.dyn (19.1 KB)

18_03_22_Forum.dyn (18.3 KB)

what is missing? I get many errors

Im sorry, i delete the “select element node”. The upload is updated.

I got a cup of coffee in the meantime, so no worries :slight_smile:

Remember list level on the family node… set to L1

But there seams to be a strange error. If all parameters are instance parameters, then it fails. Leaving just one as a type parameter, and it works!?, please add a dummy parameter you dont need there is type based as a workaround.

I have no idea why this error occur!?

Mh, i got the same results. With the one type parameter it works.

I hope it is doable for you to have a dummy parameter for now? I will try to fix it in my work of coding all my nodes in csharp?

Yes it is ok for me to work with a dummy parameter.
But the length units are not correct…i changed the python script to

Thx you for your help!

no… your input needs to be converted using “meters”, so here goes the code for doing it the right way.

import clr
from Autodesk.Revit.DB import DisplayUnitType, UnitUtils
from DSCore import Math

par_type= IN[0]
par_value= IN[1]

# output unit
dut = DisplayUnitType.DUT_METERS

for t,v in zip(par_type,par_value):
		if t=='Angle':
		elif t=='Length':
			result.append(UnitUtils.ConvertToInternalUnits(v, dut))
OUT =result

18_03_22_Forum.dyn (20.2 KB)

1 Like