Advertisement
IvaSerge

RevitNotesCollector

Jun 10th, 2017
718
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. import clr
  2.  
  3. clr.AddReference("RevitAPI")
  4. import Autodesk
  5. from Autodesk.Revit.DB import *
  6.  
  7. clr.AddReference("RevitServices")
  8. import RevitServices
  9. from RevitServices.Persistence import DocumentManager
  10. from RevitServices.Transactions import TransactionManager
  11.  
  12. doc = DocumentManager.Instance.CurrentDBDocument
  13. uiapp = DocumentManager.Instance.CurrentUIApplication
  14. app = uiapp.Application
  15.  
  16.  
  17. collector = FilteredElementCollector(doc, doc.ActiveView.Id )
  18.  
  19. textNotesId = []
  20. textNotes = []
  21. textNotesId  = collector.OfClass(TextNote).ToElementIds()
  22.  
  23. for noteId in textNotesId:
  24.    
  25.     note = doc.GetElement(noteId)
  26.     textNotes.append(note)
  27.  
  28. OUT = textNotes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement