Move View to another Sheet

Hey Ewan,

Thanks for the Reply. I had not seen your post on that thread.

I pulled out the python code and it seems to be working. Do you know what package the code came from? I know Rhythm has one but it was not working for me (I think I had a view that was placed in my list going to check on that now).

To place a View onto another sheet one must first delete the viewport (not the view). See image below.

Here is the python code from Ewan script (provided in the link above). Looks like it was originally written by @Julien_Benoit1

#python nodes in dynamo 1.2
#proposed by Julien Benoit @jbenoit44
#http://aecuandme.wordpress.com/
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

sheets = []
for i in IN[0]:
sheets.append(UnwrapElement(i))
views=[]
for i in IN[1]:
views.append(UnwrapElement(i))
points=[]
for i in IN[2]:
points.append(UnwrapElement(i).ToXyz())

# Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
viewp=[]
for s,v,p in zip(sheets,views,points):
a=Viewport.Create(doc, s.Id,v.Id, p)
viewp.append(a)

# End Transaction
TransactionManager.Instance.TransactionTaskDone()

OUT=viewp

Thanks, Ewan for the lead,

1 Like