Oscillating Element

Hi @ all,

i would like to hide and unhide an element in a given time (kind of blinking). I’ve tried to solve that taks by using a for-loop (see picture attched). Unfortunately i’m not able to get the changing “return-variable” during the loop is running.

Is there any solution for me?

Thanks in advance!
Martin

oscillator

I haven’t seen Revit update graphics while a run is in progress, generally it’s ‘bang there goes everything’ at once. Even on big complicated graphs.

I haven’t tried it, but periodic runs might work for you.

  1. Set a “blink count” parameter as an integer and make the parameter 0 by default.

  2. Have the script get the current “blink count” value and add one to that number.

  3. Divide the value by two. If it’s a whole number than it’s even.

  4. If result is even set the visibility parameter to ‘on.’ Otherwise set the visibility parameter value to ‘off.’

  5. Write the new blinkcount value to the parameter value.

1 Like

Hi @MrMinister,

I have a counter node which uses periodic updating, using the method described by @JacobSmall you should be able to get the functionality you are after.

NOTE: be careful when using periodic updating and redrawing revit graphics. Revit can take several seconds to update the graphics depending on the complexity of the view, therefore, setting a periodic interval of less than the refresh graphics time will cause a stack that never actually empties. Yoiu can get around this by having a kill switch where if the count from the counter is greater than say 5000 then return a null to stop execution.

ps. make sure to unblock the .dll by right clicking and going to properties and checking the Unblock Checkbox.

Hope this helps.

Cheers,
Dan

2 Likes

Hi guys,

thank you so much for that quick help - it works perfect!

cheers,
Martin

You’re welcome @MrMinister, don’t forget to mark as resolved! :blush: