E.setparameterbyname wont let me use another parameter


Hi,

i am currently trying to autofill my marks of my assemblies by using dynamo. i am quite new to this and i put this together. my goal is to copy my assembly name to the “Mark” parameter buy my problem is that the assembly name a “TypeName” parameter is and hence my error.

can anyone help me solve this

What is the error message you are getting? (Under the yellow triangle)

No parameter found by that name. but clearly mentions “Type” in the type properties.

What is the output of that code block? That doesn’t seem valid to me.
(maybe you can expand the previews for each node and re-post the screenshot)


When making an Assembly revit asks to fill in a Type Name which is the name i want to copy to the Mark parameter. i suppose TypeName isnt the right code for this.

Get rid of the " and the new line in the string. You want to type just Mark in there… well unless you have a parameter names "Mark"\r" which you don’t as Revit won’t let you use new lines or quotes in parameter names.

now my errors says “the parameters storage type is not an element”

No. Your code block is simply passing the input through to the output and giving it a name.

What is below is not code for assemblies (and may not work as assemblies are sort of strange from a Revit Object Model standpoint), but should give you the basic idea.

Use element.Parameters to get the list of all available parameters and to know the correct parameter name to get the value for from your assemblies.
Mark needs to be a string, so make sure what you are passing to the Value is a string.

Thanks! error is gone and it worked. but it filled in the wrong thing :expressionless:

Hard to tell why it is the wrong thing without seeing your graph, but I suspect you just passed the string “ElementType” to the Mark parameter value.

Have you gone through the Dynamo Primer on List handling and data types?

so line 31 ( Type: B.G.1.046) is what i need. i am checking the primer again now but i didnt find anything to help me before.

It looks like you want to get the Type Name from the Assembly Instance. Right now you’re just stringifying the element which is returning “ElementType”. You need to get the actual property/parameter value. Look at the value that’s coming out of String from Object. I’m guessing it’s not what you’re looking for.

1 Like

wow, spot on. didnt look at those value’s. i do need the actual value since the value is different with every assembly

Again, expanding the preview in all the nodes when you post screenshots helps other people figure out what is going on.

Not a bad practice to work with them on in general, either- as you would be seeing the data you are getting out of each node- and will probably be able to figure some of this out yourself!