I’m working on a script to prepare models for issue in the background.
One stage where im having trouble is ungrouping elements. the clockwork node ‘group.ungroup’ is returning ‘empty list’ rather than a list of ungrouped elements. ‘empty list’ is typcially returned when a non-group element is passed through this node.
This is odd, because im sure the ungroup node was working for documents before. This may, however, have just been my optimistic memory.
has anyone tried ungrouping elements in a background opened document?
Ungrouping is an action that requires a transaction in the Revit API (which, in turn, needs a document reference). The Ungroup node uses the current document for that. For it to work on other documents in the background, you would have to pass the respective model‘s doc reference. I am writing this from my phone so I can‘t be more exact than this but you could look at some of Clockwork‘s selection nodes (that have optional doc inputs) on how to modify the node to better suit your needs.
oddly, this has now stopped working the first time I press run. If I rewire the graph slightly, pressing run the second time works. is this some kind of problem with the file being open?