Place Legends/Views on Sheets by coordinates

Hello,

You can find attached our workflow, which we created with all of your helpful comments.


Dynamo automatically place every legend using the coordinates we are giving as the legend center coordinates.
Capture2
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.

Edit: Sheet-LegendPlacerBySheetNumber.dyn (12.5 KB)

Thanks in advance!

Hmhm, as far as I know, the location of an element is always set to the centre.

I’ve had a similar issue, the way I got around it is getting the dimensions of the element and then take away/minus half the of X and Y value from the coordinates; This will make it so it is the “position” from the corner.

E.g A 10x10 box from the centre positioned at 10,10,0 is the same as a 10x10 box positioned at the right-hand corner located at 5,5,0.

Hope that Helps!

Perhaps you could use the BoxOutline property of the viewport? Then as Joe proposed, calculate the center position based on the maximum and minimum points of the outline.

I don’t know if this achieves what you’re looking for, but I have attached a modified version of your script.

FORUM_LegendPlacerBySheetNumber.dyn (11.6 KB)

1 Like

Hi there,

Probably very easy, but I´m new to Dynamo and trying to place a Legend into some sheets (with correlative number) at the same time. What I´ve tried seems not to be working…Any tips for that?

Thanks in advance,

There’s an indepth discussion here:

@Daniel_Woodcock1 has done some great work with this.

Thanks for the quick response! To be honest, the routine seems to be very good, but I can´t get to understand how to use it :frowning:

Hi Ismm this is create im having one issue though and that is the y coordinates do not move the legend up or down no matter what value you add. is this something to do with the code?

Hi Matthew,

I came across the same issue and found solution.
Right click the “Place On Sheets (py)” node and select “Edit…”
Line 37 reads:
Ycenter = (maxp.X+minp.X)/2-((maxp.Y-minp.Y)/2)
you need to change that line to read:
Ycenter = (maxp.X+minp.Y)/2-((maxp.Y-minp.Y)/2)

There was a typo.
Hope this helps!

1 Like

Thank you Brittany for pointing me in the right place. i noticed when i changed to the one you have put when i changed the x value it also moved the legend in the y axis even if set to 0. So amended it to

Ycenter = (maxp.Y+minp.Y)/2-((maxp.Y-minp.Y)/2)

and seems to work. Thanks again for your help :slight_smile:

I’m trying the script provided in this topic to place a legend on multiple sheets, but when I run it, nothing happens in Revit.
Can someone please help.

Thanks!

The script is working great for me except it doesnt place the view at the coordinates I inputted, it places that at 30.49 times the coordinates.

Does anyone know what might be causing this?

Thanks so much in advance

It’s probably a units issue. Are you using Metric and/or the graph your using is converting it.
Check here for alternatives.