Skip to content

Commit 852aafd

Browse files
authored
Merge pull request #44 from hdm-dt-fb/conv
first element convenience variable added
2 parents 776286b + 3038ca5 commit 852aafd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

RevitPythonShell/init.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def get_selected_elements(doc):
3030
# old method
3131
return list(__revit__.ActiveUIDocument.Selection.Elements)
3232
selection = get_selected_elements(doc)
33-
33+
# convenience variable for first element in selection
34+
if len(selection):
35+
s0 = selection[0]
3436

3537
#------------------------------------------------------------------------------
3638
import clr

0 commit comments

Comments
 (0)