Change level assignment without moving the element

I am trying to create a routine that would allow me to change the level assignment of selected elements without actually moving them in the model.

As I understand this operation consists of two parts:

  1. change the level
  2. adjust the element offset (or z location) to compensate for level change.

I can do both things separately, but when I try to combine them, I can’t get it to work. Any ideas? This is what I currently have:

LevelChanger.dyn (11.0 KB)

Hi Emi,

you can check out this post for some advice:

Hello again.
I did some more work on this idea and I seem to have worked it out.
This is what I ended up with:

The custom node was added simply to force correct order of operations and it looks like this:

This works. It takes elements selected in Revit and changes the Level assignment without moving them in the model. Essentially this changes the element level and adjusts the level offset value in order to retain the element position in 3d space.
(Though, this version might only work for level based elements. Did not test this with workplane based elements)

The only inconvenience is that I have to manually switch input boolean to force a selection update. Every time I change the selection in Revit, I have to switch the boolean in order for Dynamo to use the latest selection.

Maybe someone knows another way to get already selected items in Revit? And/or automatically update the selection each time the graph is run?

LevelChanger.dyn (21.1 KB)

You dont have the custom Wait.node available in a package do you? Id like to try and get this to work and try it out but my python skills are lacking.

Edit: I think I replicated the custom node

This look super handy! was trying to use it but get this error at points

Looks like the original was written to handle a point based element, not a curve based one like a wall.
The start and end points may need to be extracted before feeding further nodes.

1 Like

Thanks Ewan, Hmmm this might be outside of my skills. Think I’m on the right track sort of though. Just unsure about this error. Maybe i just need to think it through more. start and end curves throwing in a whole new ball game. Might need to look into setting wall locations more

The first error is in regard to the Geometry Working Range setting in Dynamo itself. Have a look in the settings menu.

For the second error, you cannot set a Wall element location by point, as it is defined by a Curve.
If you want the wall to remain in the same place but update its reference levels you might want to try a workflow similar to this. Change Wall Levels.dyn (11.6 KB)



Thank you so much. This is great!!!

Capture please how i get fix this issued
thank you

You will need to install the #clockwork package or do the following.

1 Like