Place multiple views on multiple sheets by coordinates

Hi @Daniel_Woodcock1
Thank you for your greate job, and i tried your Dynamo script in my own projet but i got an issue message as: “Number of sheets doesn’t match either the number of view lists of location lists
All i want to do it place Multi-Schedules in one Sheet.
You can check what i’m traying to do with the pic bellow, if you want i can upload the .dyn file.
Any help will be most appreciated :smiley:

Hi @Invictus,

I think this is because your list of sheets and list of points are a flat list whereas the list of views you are trying to add are in a nested list, if you could nest the sheet and point lists by adding a code block after each with the following code [a] which will wrap the inputs into an array. This should hopefully sort the issue as the code requires the inputs to have the same data structure and in nested arrays 1 deep, where each nested array represents a sheet, a number of views and a number of locations.

Let me know if this solves your problem. :slightly_smiling_face:

I also have written up some updated code on my blog which can be found here…

Cheers,
Dan

2 Likes

Hello @Daniel_Woodcock1,
Thanks for your answer, i’ve got a new result traying to add the code block after “sheet” & “point list” with the following code [a] but still Schedules didn’t get placed on the selected sheet.
The message error is: ‘List [object]’ object has no attribute 'Id’
And the thing is that the Sheet and Schedules have their own ‘Id’
Please, be patient cause i’m still new in Dynmo :frowning: and thank your in advance for your help.
This is what i got in the pic bellow:



Ha, that’s OK @Invictus, there’s lots of people new to Dynamo on here so don’t beat yourself up and we’re all super patient as we all remember what it was like to get started! :slightly_smiling_face:

You are very close though, notice that for the sheets you now how a list of lists that are 2 deep whereas the the other lists are 1 deep, this is because you have added a list.create node as well as the code block, they are doing the same thing here (the code block is just shorthand if you will) so you have wrapped the sheet list twice in an array, just remove the codeblock that the sheets are going through and plug the sheets from the list.create node directly into the place views on sheet node and that should sort it.

2 Likes

Hi @Daniel_Woodcock1,
I tried to use List.Flatten node for Sheet list and Bloc code [a] for the Points list and it solves the problem.
Thank you very much for your help, you made my day!

4 Likes

Good stuff, glad you got it sorted @Invictus! :smiley:

2 Likes

Hi @Daniel_Woodcock1, thank you for the great Dynamo script and explanations. I am trying to apply it to my project and currently I am stuck at adding a code block [a] to create a nested list for my coordinates. It gives a warning message: Erreur:kw_class attendu

Without this nested list, I am getting the error: ‘StackValue’ object has no attribute 'Id’ at the final output, similar issue as @Invictus

It’s my first time trying to use Dynamo… Would really appreciate any help!

Hi @HLL, welcome to the Dynamo Forum!

Where are you seeing this message? On the code block or the place views python node?

From your graph, the points and views to place must have the same nested list structure. I can see that the views have 3 list levels whereas the points only have 2 levels, if you plug the point list into the code block [a], this will nest the list by another level (you could also use another list.create node), then plug that into the place views node.

1 Like

Hi @Daniel_Woodcock1,

The message is shown here on the code block
image

In fact I did try adding another list.create.node to nest the list, but I still get the same result ‘StackValue’ object has no attribute 'Id’

I notice that in the Watch node of the points, there are no green tags at the end.

Ah, just also noticed that the flatten node is also causing an issue, see how the output of that is function… This mean that’s it is still requiring an input (the amt input is not set). The flatten node once didn’t have this input and now does, so this is in part where the error is coming from.

If you could either add an input of 1 or right click on the amt input and make sure the use default value checkbox is checked, this should sort it.

Thank you for pointing that out. I have added an input of 1.

Hi @HLL, what’s the output saying… There still seems to be an issue.

@Daniel_Woodcock1

The output says ‘List [object]’ object has no attribute 'Id’
image

Try updating to Dynamo 2.0.3. Looks like you’re using a 1.x version at the moment, which would explain [a] not working as it would need to be {a} instead.

Hi @jacob.small, thank you for the explanation. I downloaded the newer version 2.0.3.
I am now able to add the code block [a], but the output error still stays the same
‘List [object]’ object has no attribute 'Id’

This Sounds like it is because you are feeding a list for one of the inputs, when the code expects a single item. Can’t tell which but try adding a [0] after a few of the variables in the code block before the python node. If that doesn’t work you may have to remove the exception handling in the Python code to understand which input needs adjustment.

1 Like

@jacob.small @Daniel_Woodcock1 Thank you both! It’s working perfectly now.

I added [0] to the Sheet, View and Location

1 Like

Hi,
Thank you for this script. it’s very good.
Just a question, for “Locations” what is the point to indicate: upper-left, middle-middle, down-right, other ?
On my script i have this dimension for placing my views:
Cotes
In my script the point are correct :Liste de points

When script excute, the dim are not correct.
Resultat
In red, what i want.
In green what i have
What is the reference point of the view for placing it
Thank

Hi @Daniel_Woodcock1

Apologies for revisiting an old post but I recently stumbled upon this and it is exactly what I’m after. The only issue is when I download the script the Views.Sheets.Coordinates nodes displays red and states that the custom node definition could not be loaded. Are you able to advise how to overcome this?

Thanks!

@Daniel_Woodcock1

Please ignore my previous post. Thanks!

1 Like