Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been trying this over and over again, and can’t seem to get it to work. I am working on a tool that should add wall tags to certain walls, however, I’m having trouble with the IndependentTag.Create() method. Below is my code (in python). I recycled this code from another tool that tags different element types and works just fine, so I’m pretty sure the syntax is correct:
families = DB.FilteredElementCollector(doc).OfCategory(DB.BuiltInCategory.OST_WallTags).OfClass(DB.FamilySymbol).ToElements()
for fam in families:
if fam.Family.Name == "MyTagName":
tag = fam
break
tag = DB.IndependentTag.Create(doc, tag.Id, view.Id, DB.Reference(wall), True, DB.TagOrientation.Horizontal, mid_point)
I keep getting this error:
Exception: The ElementId symId does not correspond to a FamilySymbol. I have checked that the "tag" element that is returned from my for loop is in fact a Family Symbol, so I'm not sure what I am doing wrong here. Any help would be greatly appreciated!
Solved! Go to Solution.