Generate a New Sheet Number from Existing Sheet Numbers and Align View to Center

Hi,

I’m trying to use dynamo for our office Level and View Standard.

Using Dynamo via Dynamo Player, I want to create a way in which a User Creates a Level with Elevation, Name and Dynamo Automatically Duplicates the View, and Place them on a New Sheet for Every Time a New Level is created.

The issue I’m having is how to generate a new sheet number for every time a new Level is created and also how to center the View on the sheet.

Would need some help with that. Thanks

Hey,

Looks good so far :slight_smile:

You obviously know what you’re doing, so I’ll just give a couple of pointers…

For the sheet number, I would presume that for the Level 3 you are showing, your sheet will be numbered something like… 2030 (20 = Presentation, 3 for level, 0 first sheet), so if you extract the last 1 or 2 indexes from the name, turn it into a number and combine it with a prefix defined in your view type, you’re good to plug it in.

As to centering the view on the sheet, there are other methods, but if your sheet is A2 landscape, then you will know that the placement of the view is 210 by 297. @Greg_McDowell talks of a method here Finding the Center of a View... not a Viewport he can share? It would take me a bit of time to recreate the worflow described in the post, but I can have a go if he’s not around :slight_smile:

Hope that helps,

Mark

Thanks for your response and Pointers.

Here’s the thing.

I want for every Level Created, Like Level 3, A presentation View is created LEVEL 3 PRESENTATION, the presentation view is now placed on a created Sheet say P03 if P02 was the last on the Sheet Group, and then the View would be on the Center of the Sheet Created.

I’ve been trying to wrap my head around this…

Attached is the script in case anyone want to help out… thankyou

Create Levels and Duplicate Views.dyn (90.5 KB)

Hi,

Sorry I’m not sure I understand…

The nice thing about your system is that the if someone makes a new level, the P03 is going to be the first sheet, so you don’t need to worry about clashing numbers with other sheets…

Otherwise, if you are just following on from sheet numbers already created, you need the current list of sheet numbers and you are adding one on the end?

Cheers,

Mark

Yes, yes… that’s what I want to do… I want to limit user’s Input as much as possible so the Sheet Number would be called up from the list of already created sheets +1 so as to avoid clashing numbers.

Like this?
Edit:

Exactly.

Great :slight_smile:

Here’s what I’m attempting, but then I’m stuck… I cant convert string to Number…

Yeah, it’s a bit unfortunate, you’ll obvs not be able to make something with D in it a number… it needs to be split, converted, added, converted back and recombined… Complete faff… if you use node to code or make a custom node, it will make your graph easier to read…
SheetNumber.dyn (10.1 KB)

Thank you very much for the help… I owe you lots…

Here’s what Ive been able to do with it and it works.

Now it’s to get the View to be located at the center of the sheet…

I hope that’s possible also…

Another Error I’m getting is After Creating the First Level,

When I run the script again, Dynamo automatically renames the previous level created and then is unable to create a new number for the New Sheet, cant figure out why I’m getting such errors

It sounds like Dynamo hasn’t refreshed properly…

If you run, then close dynamo and reopen, does it still happen? Or are you running through player?

Yes, it does the same thing both manually and via Player… Just tried it now and it did the same thing…

Have any Idea why that is happening?

Here’s the script

Create Levels and Duplicate Views.dyn (187.6 KB)

Unfortunately my dynamo 2 has gone screwy and is refusing to recognise any titleblocks exist in my project…!

Maybe someone else can help you better…

From staring at your graph, my guess is that the problem is here? image
You are getting the first sheet number? I don’t know why you wouldn’t get the last sheet number?
image
If you get the first one, then everytime you add a sheet it is trying to use a number you already have…

Hope that helps,

Mark

Okay, Let me try the Last Item and see if that works

Still getting Same error…

Level still gets overwritten and views on sheet too

Could you drop a few more screen grabs?

It’s hard to know whether it’s a simple fix (maybe you just put the same height in again) or something fundamental (a node isn’t functioning as we’d expect)

Unfortunately, as I said, I’m not going to be too much more help with my Dynamo not working.

Apologies,

Mark

Thank you for your response and help so far.

I’ll be posting a few more screen Grabs Shortly

See the Error Im getting together with a snapshot of my script…

Please anyone else can help