Extract Element ID from List of Selected Elements

I am so close!! I’ve selected all text elements in “placed” views. I’ve created a list of those elements and removed the “List is Empty” values. Now I have my desired selection in the form of a list. The list of elements shows the element type, and Element ID. How can I use the Element ID data in that list to re-select those items and get parameters etc. End goal is to export all text (placed views only) for spell check. I am having such a hard time understanding lists. Any ideas?

@jwinklerQ3ZUJ ,

you grab the element(s) itself get the id first!

KR

Andreas

Problem is, I am initially selecting the text using Select.ByCategoryAndView which works great, but I get some “Empty List” values which then need to be purged using List.Clean. At that point the selection of Elements becomes a List and I can’t seem to extract parameters. I can see the Object ID’s at the end of each item in the list, I would just like to use those to create a clean selection before extracting parameters.

@jwinklerQ3ZUJ ,

than filter it out

KR

Andreas

From the list of TextNote elements you can just wire in a TextNote.Text value to get the text, and a Element.GetParameterValueByName to pull the desired parameter values. No need for an added selection - you’ll just wind up with the same structure you have now!

That almost works. The TextNote.Text node extracts the text value as desired, but the Element.GetParameterValueByName is having trouble I think because it is reading from a list instead of directly from an element. I need the “Workset” value of each text element because it includes the View Name. It seems to return some kind of a number.

Regarding @Draxl_Andreas earlier solution, That’s a nice filter, but I’ve already got that. My problem is extracting a text string and workset name from the clean list.

Actually I believe that these values are correct. They are the element ID of the workset, rather than the string. In the Revit UI these show as strings as the UI displays the name because referring to the element ID as a user would suck, but the element ID has to be what is stored to ensure we are referring to something which exists. You could utilize another method for pulling these values (ie: Python) to confirm, or you could access the workset with the Element.Workset which I believe is the clockwork package but it may be in another common package.

All of that said, you indicated that the initial collection of text notes was by view, which would indicate you already have the view name and can therefore infer the workset directly if you just keep the list structure.

@jacob.small -You’re right. The numbers represent the workset. If I could just find a way to convert that value into what I see on the screen


I would be good 2 go. But I guess I need to go back to the “unclean selection” to get view names, then create a separate list of those view names and somehow weed out the same elements from that list. I’m also thinking of using the list of view names along with workset numbers as some kind of a legend for the cleaned list. I am definitely in the weeds here. Just trying to export all text notes for a spell check! Thank you for your help! I’ll post if I solve this.

Revit has a built in spell check already, why do this with dynamo?

Trying to select all text in 120 views (regardless of type) for a final check before CD’s go out.

The built in spell check is likely going to be more effective overall (even on the 120 views).

That said, the workset and view aren’t needed for this process.

  1. Use Dynamo to get the selected views, gather all text elements in the view, get the GUID of each text element and the text value as paired 2d list, and export the pairs to CSV.

  2. In your editor of choice, run spell check on the second column of the CSV, overwriting the previous value(s).

  3. In a new Dynamo file, read in the CSV data, transpose and split into individual lists so you have a list of GUIDs and a matching list of desired text note values. Take the first list to select the text notes (wherever they may be), and then use the second list to set the text note value.

I suppose you’re right. I’m kind of fixated on this idea of being able to print a report of ALL the spelling errors to bolster my argument of using keynoting and tagging vs. manual text notes. Might not be the best PR move for a BIM Manager lol. Also was hoping to use this to manage rogue text styles within the project. Anyway I did learn the Elements.OwnerView appears to report the view of each text element. That’s the one I was looking for. I will post the spell check script once I finish it. THANK YOU!!

1 Like

#spell #spelling #spell check

Attached is the finished Spell Check graph As recommended by @jacob.small It will select all the “Text Notes” IN PLACED VIEWS ONLY. It extracts 3 columns of data from the selection set…Element ID | View | Text String. It combines the 3 lists and exports to Excel. When Excel opens, I can perform a spell check on the 3rd column SEEING THE CONTEXT AS IT GOES. I can change any of the values and because the element ID stays the same, I can run another graph and import the data back to Revit. This is great for 10 minute QA checks at our firm before a drawing set is printed. My future goal is to include Drawing Names, Numbers, Schedules, and even Keynote Tables (that’s the hard one). Thanks for the help!
Export Text Notes to Excel.dyn (91.7 KB)
Import Text Notes from Excel.dyn (32.8 KB)
You can use the same excel file - it will overwrite the data each export.

1 Like