I would like to select an object in a linked model, then run a dynamo script based off the current selection. Currently, I know of nodes that will allow you to select a link element (SelectLinkedElement: Springs), but they don’t work on elements that are already selected.
Why not build the script to prompt for selection? There’s no difference between “select then run” and “run then select” in this way.
Yeah, I know. It’s just that all of the other scripts we have in our office are select-then-run. It throws off some people, that’s all. Everything being equal I’d like to keep them consistent, but if that’s not an option then I’ll move on. It may just have to be a matter of education.
That’s understandable. If you already have the code for “select then run” then you should have the “hard” part figured out. It should be the same regardless of whether the element is local or linked, you may just need to change your code to provide the linked document in certain areas. It would be easier if you could show us the code and any errors you’re getting.
Well, there isn’t too much to show. I’m not really getting any errors—I just need to find a node sim to ‘collect.currentselection’ which allows you to selected something in a linked model. The current springs mode just returns ‘null’ (unless I’m doing something wrong). I’m currently using ‘selectlinkedelment’, but that requires a run-then-select workflow.
I see. I thought you had written your own code to run with the active selection. In that case you’ll want to pull the python out of the
CurrentSelection node and modify it to allow other documents (I’m assuming that’s the problem).
You should be able to find some other posts here dealing with modifying existing python code to work with input docs. It’s usually pretty straight forward.