Move View to another Sheet

Hello all,

I have been looking but I cannot seem to find a way to move a view from one sheet to another.
I am trying to match a source file for view placement. I have matched the views and sheets but I cannot find a way to move the view to its proper sheet.

Is there a node or a package that I am glancing over?

Thanks,

Did you find this topic?

1 Like

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

Hi Steven,

Yes, this python was from the #steamnodes package and was within the node Tool.PlaceViewsOnSheets.
(Steamnodes is a cool package to keep handy :grinning: @Julien_Benoit1 :+1: )

The only reason I took this out into python for the graph was to reduce the dependencies, as I hadn’t gotten Dynamo player set up to work with network packages for our team at the time.

Glad you got it sorted.

1 Like

Thank you very much. It works.