Code Block - definition error

Hi All,

I am new to dynamo and have been following a tutorial and have hit a bit of an issue regarding a “Code Block” definition.

Basically, in the tutorial the guide successfully has the following definition in the “Code Block” it is as followings:

"Elements.Element.GetParameterValueByName(GN, “Name”)
"Elements.Element.GetParameterValueByName(GL, “Name”)

Can anyone tell me why the “Elements” part of the code doesn’t activate? Is this due to a coding command change or something?

Attached is an image to help describe the issue I am outlining above.

Cheers,
Michael

Can you try this?

Revit.Elements.Element.SetParameterByName(elements,Parameter,Value)

Thanks for the idea, but unfortunately doesn’t work either

In the image, It looks okay. Do you get any error message when you run the graph?

No, no error. But from what I can tell the first section of the code “Elements” should turn a blue colour. At least this is what occurs in the tutorial. I have included an image from the youtube video. Sorry if it is too small to read… Tutorial

That syntax highlighting can change based on your Dynamo build or what packages you have installed, so likely it has to do with the age of the video you are watching vs the age of your Dynamo build or that they have some package you don’t. The good news is that it has no impact on your code actually executing. Color wise I don’t believe it should highlight as it is the library/module name not the class or function name.

Note that the you can confirm the content needed to call for the library/module by using node to code. Save your graph, place an Element.GetParameterValueByName node on canvas and wire in the inputs, then select it and right click on the workspace background and select ‘node to code’ and the full library/module, class, and function name should be given in a new code block.

2 Likes