Advertisement
Dmitry_Dronov

VP.Sheet to sheet

Oct 21st, 2014
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import clr
  2. clr.AddReference('RevitAPI')
  3. from Autodesk.Revit.DB import *
  4.  
  5. clr.AddReference('RevitServices')
  6. import RevitServices
  7. from RevitServices.Transactions import TransactionManager
  8.  
  9. doc = IN[0]
  10. TransactionManager.Instance.EnsureInTransaction(doc)
  11.  
  12. sheet = doc.ActiveView
  13.  
  14. for viewport in IN[1]:
  15.     exVp = UnwrapElement(viewport)
  16.     loc = exVp.GetBoxCenter()
  17.     view = doc.GetElement(exVp.ViewId)
  18.     doc.Delete(exVp.Id)
  19.    
  20.     newVp = Viewport.Create(doc,sheet.Id,view.Id,loc)
  21.    
  22. TransactionManager.Instance.TransactionTaskDone()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement