Skip to content

Commit 942c77d

Browse files
authored
Update Tools_MoveRoomTagToRoomCenter.py
See PR gtalarico#20
1 parent a6b8341 commit 942c77d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

0-python-code/Tools_MoveRoomTagToRoomCenter.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""
2-
Moves all selected tags to the center of their corresponding rooms
2+
Moves all tags to the "Room Location Point" of their corresponding rooms
33
44
TESTED REVIT API: 2015, 2016, 2017, 2017.1
55
66
Author: Gui Talarico | github.com/gtalarico
7+
min.naung | https://twentytwo.space/contact | https://github.com/mgjean
78
89
This file is shared on www.revitapidocs.com
910
For more information visit http://github.com/gtalarico/revitapidocs
@@ -16,17 +17,15 @@
1617
clr.AddReference('RevitAPIUI')
1718

1819
from Autodesk.Revit.DB import Transaction
19-
from Autodesk.Revit.DB import FilteredElementCollector, BuiltInCategory
20-
from Autodesk.Revit.DB.Architecture import Room
20+
from Autodesk.Revit.DB import FilteredElementCollector, SpatialElementTag
2121

2222
uidoc = __revit__.ActiveUIDocument
2323
doc = __revit__.ActiveUIDocument.Document
2424

2525
###########################################################################
2626
# TAG COLLECTOR [IN VIEW BY: doc.ActiveView.Id]
27-
room_tags = FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(
28-
BuiltInCategory.OST_RoomTags).WhereElementIsNotElementType().\
29-
ToElements()
27+
room_tags = FilteredElementCollector(doc, doc.ActiveView.Id)\
28+
.OfClass(SpatialElementTag).ToElements()
3029
###########################################################################
3130

3231
transaction = Transaction(doc, 'Move Room Tags on Room Points')

0 commit comments

Comments
 (0)