Getting all element IDs sent to clipboard from dynamo script

Hello, I am trying to out put the element IDs to my clipboad from my dynamo output so that I can easily select all the elements in revit via the “Select by element ID” feature. to do this I need to have a single string of all the element IDs separated by a “;” for each one. I thought I knew how to do this but its not working, please advise.

use String.Join

http://dynamoprimer.com/en/04_The-Building-Blocks-of-Programs/4-4_strings.html

3 Likes

Good solution. However I’ve had issues with the newline created this way for this exact issue in the past. Use a string for the code block containing the ; instead to avoid those issues.

1 Like

I was wondering why it was doing that.

Thanks Jacob,

2 Likes

Actual reason is because the ; is a special character marking the end of a line in design script. The new line is hard coded and avoiding it in a script is difficult as the esc character only works if you catch it the first time (I usually don’t).

1 Like