Insert Legends by template not by co-ordinates

Hi all,

I’m trying to create a script that copies the all the schedules from a template sheet then places them in the identical location on other sheets.

I’ve started by trying to modify Daniel_Woodcock1 's insert legend placer and inserting a python script that Konrad has done in a previous post.

But I get this error, excuse my lack of knowledge when it comes to the API and python. Complete novice in that regard.


schedules on sheet test.dyn (25.1 KB)

Regards

Hi @James_Washbourne,

With a quick glance I can see you are trying to place ScheduleSheetInstances (sort of like a viewport for schedules which is a visual representation of the view on sheet and not the actual view (if that makes any sense at all). This is not allowed I’m afraid as the node takes a ScheduleView only, however, you can get the ScheduleView from this and is done like so…

image

The GetOwnerViewSchedule (Py) node has the following code…

import clr

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc =  DocumentManager.Instance.CurrentDBDocument

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

def tolist(obj1):
	if hasattr(obj1,"__iter__"): return obj1
	else: return [obj1]
	
schShtInsts = tolist(UnwrapElement(IN[0]))

outList = []

for ssi in schShtInsts:
	outList.append(doc.GetElement(ssi.ScheduleId))
	
OUT = outList

And you should place it about here…

I think this should work. Let me know how it goes!

Cheers,
Dan

Hi Daniel,

I’ve had to do a unit conversion but works like a dream. So that’s sorted. Thank you very much.

Second question, is there a way of filtering the views from the springs.Sheet.Views+ by type. So I get a list saying whether is a floor plan or 3d view etc. I’ve tried the Element.get parameterValueByName node, but its not giving me the results I’m after.

filter

Thank you

@James_Washbourne you need to mark the solution given by @Daniel_Woodcock1 and create a new topic for your second query. We can’t have many solutions in one topic. Thanks!

1 Like

Kulkul,

Done thank you

i have a problem with the location of the schedules they go so far at the new sheet … any help

Hi @ae19891989, I’m not sure what you mean. Can you please show an example or graph or any errors you are getting.

I also have some new code for legend/schedule copying in the link below…