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.
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.
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!
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.
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.
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.