Insert Legend in sheet

Hi @gijodaigas,

You are not passing a sheet element into the node, you are passing just text from what I can see. You need to plug your sheets from the “all elements of category” node into the “list” port of the filter by bool node as you are currently just getting the parameter value and passing this as a as a sheet which won’t work. Also, flatten the list of views before plugging it in also.

Let me know if that works?

Cheers,
Dan

1 Like

@Daniel_Woodcock1
It works, thanks again. The only problem now is that, if I use it for the second time, (for instance for placing another legend in other sheets), it place the new one on the correct sheets, but it adds this new one to the previous sheets too. So In the first sheet, I have 2 overlined legends.

Really Great, Many thanks

1 Like

to continue this great tread, i also im stuck with the same challenge as the poster above.
I am looking to place 1 schedule per sheet as shown in this capture. but the code right now places all view into all sheets, its probably something simple that im yet to graspt.

1 Like

Hi @Wuillian_Medrano,

To be clear, are you trying to place legend 1 on sheet 1, legend 2 on sheet 2, legend 3 on sheet 3 etc.

Cheers,
Dan

1 Like

Yes, that is my goal at this point. Best Scenario would be to match any number of views to a desired sheet and repeat. Anyone else interested, this post is also related with graphs.

1 Like

@Daniel_Woodcock1 I am having an issue trying to run this workflow with just one sheet. Can you advise me on what I am doing wrong?

Hi @patrick_podeyn,

Are you using the version I posted?

Also, what package is Sheets in? I don’t have this node apparently.

Cheers,
Dan

Hi @Daniel_Woodcock1, it is a node in @john_pierson’s package called rhythm.

Hi @patrick_podeyn,

Ha, I’m really slack with the package updates. I tested with @john_pierson’s sheet node and it’s working fine for me…

What error message are you getting in the yellow balloon? You may be using one of the older versions of the node as it only has 3 ports and the new one has a refresh port.

Cheers,
Dan

I got it fixed, @john_pierson actually assisted me, the input I was feeding “IN[0]” was not correct and we got that sorted. Is it possible that you can make this a custom node and publish it on the package manager? This workflow is really awesome and very beneficial!

1 Like

Daniel,

I am trying to use your node to place different schedules/legends in different locations on different sheets all at once based on our company’s standard sheet layout, but it is not working. Is there something that I am missing?

Hi @PR_matthew.terry,

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…

Place multiple views on multiple sheets by coordinates

This should be able to place pretty much any View Type and you can visualise them pre-placement (if you want).

Let me know how you get on.

Cheers,
Dan

Does anyone have a workflow for getting the XY of a legend placed on a sheet?

A legend is categorized as a schedule.

schedule = UnwrapElement(IN[0])
point = schedule.Point

Hi @Architecture_Faster,

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.

Alternatively, you could do something like this…

And get the centre from the polygon, or average the endpoints etc etc…

This however is a question in its own right, so you should really start a new thread. :wink:

got it thanks

@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.

Hi @Nick_Boyts,

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…

image

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). :slight_smile:

Cheers,
Dan

Weird, I could not get the viewport of my legends earlier. Thanks @Daniel_Woodcock1 for clearing this up!

1 Like