Edit existing Floor Boundary

How would I go about editing an existing floor/ceiling boundary?
Rather than creating new elements to follow a defined polycurve, I want to update the sketch of an existing element.

I’ve got as far as using the Collect.ElementSketch node from Springs, but I’m not sure how to write the info back to the floor element.

2 Likes

This might be a good place to start with modern Revit builds, as the sketch edit api is now exposed.

2 Likes

Thanks @Vladimir, I tried this method and got this far:

It works perfectly for floors that have the same number of edges, however in the above example the source floor has 6 edges, which causes issues. Any suggestions?

Also, thanks @jacob.small, but I fear I might have been using your example incorrectly as I couldn’t get any results. I’m using Revit 2023 & Dynamo 2.16.

No one can tell you if it is being used right as you haven’t shown how you are using it, however you may have to edit the Python code to make it work.

This is the error I’m getting faces with.

PythonEvaluator.Evaluate operation failed.
Traceback (most recent call last):
File “< string >”, line 50, in < module >
exception: Illegal attempt to modify element. Reason: EditModeMgr element modifiable checker

I cannot duplicate the issue you’re seeing. Can you post your rvt and dyn with the selected source and target elements?

Revit 2023, Dynamo 2.16

Working fine for me - what issues are you seeing?

modify sketch

So I’ve just reopened the rvt file and the dyn script, and it’s now working perfectly!
Sorry, no idea what was cause that error with the final python script previously.
Thanks for your help!

1 Like

Hi @jacob.small, I’m expanding on this idea, and looking to iterate the process for multiple floors. The Sketch Plane script is working perfectly when the input is a single floor, but it’s throwing up the following error when multiple floors are input:

PythonEvaluator.Evaluate operation failed.
Traceback (most recent call last)
File “< string >”, line 29, in < module >
AttributeError: ‘List[object]’ object has no attribute “SketchId”

I’m assuming this is because the input is a list as opposed to an element. Apologies my Python knowledge is currently far too lacking to overcome this issue. Could you please advise on either how to adjust the code, or any other workaround.

Thanks,

You have two options.

  1. You could incorporate a loop into the Python code. Either as a For loop, or via list comprehension. There are numerous examples of both on the forum already (and even a few loops in the code which you’re using if memory serves), so search around and you should find something to provide some guidance.

  2. You could wrap the Python node in a custom node and leverage that. There is an example of how to do this on the Dynamo Primer.

1 Like