Getting all element IDs sent to clipboard from dynamo script


#1

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.


#2

use String.Join

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


#3

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.


#4

I was wondering why it was doing that.

Thanks Jacob,


#5

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