- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everyone;
I am trying to get a list of the elementIDs of text styles (TextNoteType) by suppling the names of the text styles. The text style names come from a CSV data file where each line (record) contains the name plus other info.
So I have used the following code in Revit Python Shell to get a list of text styles:
ListOfTextStyles = FilteredElementCollector(doc).OfClass (TextNoteType)
a = ListOfTextStyles.ToElements()
One of the properties shown by RPS when I type "a.it.." is this:
Am I correct that Item is an indexer of some kind and that if I formatted the call correctly that I would get a specific TextNoteType by specifying its name? A call something like this: TextStyle = a.Item(Property = "Type Name")["style name"]
My understanding of indexers is fuzzy at best but I gather an indexer is a way to access a collection of objects. For example, the indexer used to get items from a python list would be an integer indicating the position of the item in the collection. And for a python dictionary, the indexer would be the key value of the item in the collection. Would this be correct?
Can someone tell me if I can do what I think I can? And if so, how?
Sincerely;
Michelle
Michelle
Solved! Go to Solution.