Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Last active June 13, 2020 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/67f33ffc2e125457d83a5d39d39ae01e to your computer and use it in GitHub Desktop.
Save chuongmep/67f33ffc2e125457d83a5d39d39ae01e to your computer and use it in GitHub Desktop.
from Autodesk.Revit.UI.Selection import *
uidoc = __revit__.ActiveUIDocument
doc = __revit__.ActiveUIDocument.Document
selection = [ doc.GetElement( elId ) for elId in __revit__.ActiveUIDocument.Selection.GetElementIds() ]
ElementID=[]
ElementName=[]
Category = []
for i in selection:
ElementID.append(i.Id)
ElementName.append(i.Name)
Category.append(i.Category.Name)
print ElementID,ElementName,Category
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment