|
1 | 1 | """ |
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 |
3 | 3 |
|
4 | 4 | TESTED REVIT API: 2015, 2016, 2017, 2017.1 |
5 | 5 |
|
6 | 6 | Author: Gui Talarico | github.com/gtalarico |
| 7 | + min.naung | https://twentytwo.space/contact | https://github.com/mgjean |
7 | 8 |
|
8 | 9 | This file is shared on www.revitapidocs.com |
9 | 10 | For more information visit http://github.com/gtalarico/revitapidocs |
|
16 | 17 | clr.AddReference('RevitAPIUI') |
17 | 18 |
|
18 | 19 | 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 |
21 | 21 |
|
22 | 22 | uidoc = __revit__.ActiveUIDocument |
23 | 23 | doc = __revit__.ActiveUIDocument.Document |
24 | 24 |
|
25 | 25 | ########################################################################### |
26 | 26 | # 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() |
30 | 29 | ########################################################################### |
31 | 30 |
|
32 | 31 | transaction = Transaction(doc, 'Move Room Tags on Room Points') |
|
0 commit comments