I guess we are all familiar with the copy to clipboard command in Revit. Is there some way I can replicate that in Dynamo? Essentially what I am looking to achieve is copy hosted elements (e.g. a door) to the clipboard, delete the host wall, and paste it on a newly created wall in its place.
I have tried the Copy Elements To Same Place node from Bakery and Copy from Document Node from Rhythm by giving input as current document but they do nnot work as the elements get deleted as soon as the host gets deleted. So if by some way I can copy to clipboard instead, I’ll be able to paste them later, even after the host is no longer there.
I don’t want to change the type! The type should be the same. I can understand that changing the host is not possible, that is why I asked if we could somehow copy to clipboard? Doing that is possible within Revit and it does change the host that way. Looking to do the same in Dynamo.
The splitting has to be done for quite a few elements (in 1000s) at specific points. I have achieved the wall splitting using a Dynamo script but am stuck at this problem of elements losing their host.
The process I used can be inferred from the discussion here:
Essentially I have used some nodes from DominaDynamo, as was suggested in the solution for this topic. I wasn’t sure if I should reply on the same thread as the topic was different and solved, hence I created a new thread.
Could you get your existing walls’ path, split the curves as necessary, then create new walls based on those curves and delete the original walls? It seems like creating new walls based off the existing geometry would be easier than manipulating existing walls themselves.__
Yes. The only issue that I am facing is that the doors get deleted as soon as the script runs so I am unable to retain any information about them and all the nodes return null values. That is why I wanted to know if a way exists which can retain the information about the elements - maybe on a clipboard - so that it can be run after the original elements have been deleted.
I have used Transaction.Start and Object.Identity nodes to delay part of the script as I found them on other places on the forum but I don’t think they will be useful for this task. They were useful for placing the new walls after deleting the old ones though.
Are you using the Springs HostedInstance.ByPoints node? It takes a host element so you should be able to specify which wall. However, I can still see it potentially having issues if another element matches the surface exactly.
I have a sneaking suspicion that the Clipboard is asking for trouble. Yes you can send things to the clipboard and paste them automatically, but doing so with that large of a data set is going to be problematic.
This is a crazy thought but…
Save the project as prior to running the script.
Set things up to read/map hosts so that you’re getting the same elements in the new file and the old.
Get everything hosted in the referenced model.
Create a new instance on the new host for every hosted element.
Set parameter values for the new elements based on the values in the old model.
Yes, I agree this may be a solution but saving as is a manual step I guess.
I have a thought that Excel could be used as a data dump or “Clipboard” and that information can then be read back in Dynamo from excel even after the elements are deleted. Still looking for a better solution though as this will involve running 2 scripts.