-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSelection.py
More file actions
21 lines (20 loc) · 905 Bytes
/
Selection.py
File metadata and controls
21 lines (20 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#public
def classifyElementsByCategory(uidoc, selection_filter, prompt):
filters = SelectionFilter(*selection_filter)
elSelectAll = uidoc.Selection.PickElementsByRectangle(filters, prompt)
# Use a dictionary to store elements grouped by category
categorized_elements = {}
for element in elSelectAll:
category_name = element.Category.Name
if category_name not in categorized_elements:
categorized_elements[category_name] = []
categorized_elements[category_name].append(element)
return categorized_elements
def isolateElement(self,elements):
TransactionManager.Instance.EnsureInTransaction(doc)
reset = View.DisableTemporaryViewMode(TemporaryViewMode.TemporaryHideIsolate)
IDS = List[ElementId]()
for i in elements:
IDS.Add(i.Id)
View.IsolateElementsTemporary(IDS)
TransactionManager.Instance.TransactionTaskDone()