Apologies for the delay in response, I was on holiday and miles away from technology. From observation I believe the sheets should be a single list rather than a nested list as you currently have it, however, I have also updated the code some and the new updates can be found in this thread…
I assume you are making a legend copier. Legends on sheet are a viewport element. There are probably a few packages out there that have something like a viewport.centre node. I have one somewhere, but lack a pc right now.
@Architecture_Faster
Schedules and legends don’t actually have viewports, at least none that I could find. The code I posted above is a quick and easy way to get their location on a sheet.
Schedules on sheet are part of the ScheduleSheetInstance class, whereas, Legends are viewport based View Elements. So, you are correct in what you say with Schedules, but not with Legends. Observe the following…
ViewPort.GetBoxCenter (Py)
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
def tolist(obj1):
if hasattr(obj1,"__iter__"): return obj1
else: return [obj1]
vps = tolist(UnwrapElement(IN[0]))
outList = []
for vp in vps:
outList.append(vp.GetBoxCenter().ToPoint())
OUT = outList
ScheduleSheetInstance.Point (Py)
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
def tolist(obj1):
if hasattr(obj1,"__iter__"): return obj1
else: return [obj1]
vps = tolist(UnwrapElement(IN[0]))
outList = []
for vp in vps:
outList.append(vp.Point.ToPoint())
OUT = outList
Legends however, as with drafting views, do not have a crop region like most other view type Elements. But both are viewport based when on sheet which means we can treat them like any other view type when placed on sheet (except for schedules and keynotes).
Hi everyone. I´m new in Dynamo, i need to know te coordinates of the legend. I need to place it on a specific place on my sheet but i don´t know wich number i should put on the coordinates. I hope someone could help me.
Bless from México. Tank u
Hi, got this to work for a selected range of sheets by sheet number. Just curious why i get so many failed sheets? Is there a better format i should have?
But we have the same issue as @simvas had. Dynamo automatically place every legend using the coordinates we are giving as the legend center coordinates.
We are trying to insert some node so Dynamo can understand that the given coordinates are from the upper left corner from the legend (where the title is), but we can’t find such packages.
That error looks like you aren’t iterating over the list to get single instances. Would you post the code in the node? Also, may have been better to create a new post since this one is set eral years old.
Also, see this topic for reference. Schedule location is different than Legend location.
It is your lists. You are tring to place multiple Schedules on one sheet and most likely the Place Views On Sheet node isn’t set up to do that. Test it with one schedule and see if that works. If so, you may need to rework the node or do them one by one.
Hi Sorry for such a late reply, just saw this post…
i have also created a dynamo script to place multiple legends on multiple sheets.
the workflow is as below:
Create a Dummy/Reference sheet & place one instance of all the legend in exact location.
Use dynamo to query that reference sheet.
Get view ports & views of that sheet, this would give you the legends on that sheet as well.
Use data shapes package for Reference sheet selection as well as selection of legends from the reference sheet.
use data shapes again to select the sheets you want to place the legends
Now the idea is to query the view port location from reference sheet for legends & use that as locations to be placed in multiple sheets.
you would have to cycle the locations as well as the legends depending on how many sheets you are pasting the legends into.
this workflow would ensure a generic approach for almost all, your projects.
this would also ensure you dont need to worry about manual insertion of legends or moving around using sliders .
thanks