Sheet.Views

Hi everyone,
im trying to find out if a Sheet as a View on it. I’m pulling all the Sheets through the Get Documents + Get All Elements From Linked Model.
Sheet.Views returns and empty list and Sheets.Viewports returns an ambiguous call.

Does anyone know any work around this limitation?
Thanks

maybe this?

@m.rijsmus and @SeanP,
Are your methods working on linked files? @Daniel_Hurtubise specified that he is getting elements from links.

Thanks for pointing that out @john_pierson. I had missed that without an image for reference.

@john_pierson
This is a new try, you are right.

If you modify the springnodes node, Springs.SheetViews+ to accept a document input, it will get the views.

and the python code:

#Copyright(c) 2016, Dimitar Venkov
# @5devene, dimitar.ven@gmail.com

import clr

clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
doc = IN[1]

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *

def tolist(obj1):
if hasattr(obj1,"__iter__"): return obj1
else: return [obj1]

sheets = UnwrapElement(tolist(IN[0]))
sheet_views, sheets_scheds = [], []
rev_str = "<Revision Schedule>"
sched_dict = dict()
fec1 = FilteredElementCollector(doc).OfClass(ScheduleSheetInstance)
for s in fec1:
if rev_str not in s.Name:
key = s.OwnerViewId.IntegerValue
if key not in sched_dict:
sched_dict[key] = [s]
else:
sched_dict[key].append(s)

for i in xrange(len(sheets) ):
viewsid = sheets[i].GetAllPlacedViews()
views = [doc.GetElement(v).ToDSType(True) for v in viewsid]
sheet_views.append(views)
s_id = sheets[i].Id.IntegerValue
scheds = sched_dict[s_id] if s_id in sched_dict else []
sheets_scheds.append(scheds)
OUT = sheet_views, sheets_scheds
4 Likes

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
watch =
for i in IN[0]:
test = len(UnwrapElement(i).GetAllViewports()) > 0
watch.append(test)
OUT = watch

Will also do the trick
Thanks @john_pierson

I think I must be missing something but John could you use the recently updated Sheet.GetViewportsAndViews in Rhythm? It has been working great for me.

4 Likes

I am getting forgetful these days. :joy:

3 Likes