Wall not updated in model on Element.SetParameterByName


I’m an experienced programmer but have never touched Dynamo until yesterday and I am really enjoying the easy and straightforward approach. I have, however, got stuck on something very particular and I have not seen anyone else experiencing this after a lot of googling so I’ll just have to post my first thread here and hope to get some input from the experts.

Long story, but I need to replace a bunch of windows with walls of a particular type. This is what I have automated and it is working great… about 70% of the time. I can not find any kind of consistency on the failures, they look to be entirely random to me. So far I am only replacing one window at the time and I can do it on the same window and have it work 3 times and then fail the fourth time. Also when replacing other windows it simply works sometimes, others not. No errors or warnings are generated.

The procedure creates a wall with the height of the selected window where the window is placed and then uses Element.SetParameterByName to set “Base offset” to the window’s “Sill Height” (since there is no Node that I can find that can reliably create a wall with a certain Base Offset from start).

Most of the times it works like a charm but others the newly created wall gets stuck on the wrong height off the floor with its base 915mm off the Sill Height rather than on the Sill Height (that is 915mm off the floor).
Here is the weirdest part, when I go into revit and look at the walls properties the Base Offset is in fact set to the correct value… the new wall is simply being rendered int he wrong place!
I can open new views or save document and close and re-open, it is still being shown in the wrong place but with the correct numeric property value. The sill height I set from Dynamo is currently 915mm, if I manually (in the properties box in revit) set it to 914, click “Apply” and then change it back to 915 it renders perfect where it is supposed to be.

If I simply skip the Element.SetParameterByName I have the same problem except that the wall (on failures) is being rendered with its base on the floor. However, most of the time this works perfectly too.

So to me it looks like Dynamo is playing its’ part well but somehow the revit model fail to update the Base Offset as instructed by Dynamo.

How come the properties can be set correctly but still the element is being shown in the wrong place? How can I get around it? Any type of “force refresh” of the element?

Thank You for your time!

Hi @KrisJ

Welcome to Dynamo Forum!
To answer to all your questions please drop screenshots of your graph here with all the previews visible for all the nodes.

Thank you!

Unfortunately I never took a screenshot and now I have completely rebuilt it. Seems to work when I made sure the line for creating the wall was on the floor level.
(Now I am experimenting with getting it to work as a batch operation.)

I’m still curious of the weird error though. Has anyone else experienced a property being set correctly but not displayed as such? For example the wall Base Offset that I described earlier.

Running graphs repeatedly will often result in wired issues like that if your graph isn’t set up right. We’d need to see it to know for sure though.