Extract information from a file name list to create Revit sheets

I feel this should be fairly simple but I can’t seem to get it. I’m trying to take a list of .dwg files from the project directory (our civil dept uses Civil 3D) that contain the sheet name and number and create Revit sheets. I’ve got it down to just the file names without extensions but I need to sort the sheet numbers and names into two different lists in order to create the Revit sheets.

Hello something could probably work in that case

1 Like

See if these nodes/ examples can inspire you:
https://dictionary.dynamobim.com/#/Core/String/Action/Remove
https://dictionary.dynamobim.com/#/Core/String/Action/Substring

Ah, @sovitek beat me to it :smiley:

1 Like

Hope this helps.
Takes awhile to understand how to deal with strings on Dynamo.

1 Like

nice one…probably we could use regex here as well…

@sovitek Worked perfectly!! I knew there was a way. I’m fairly new to Dynamo but I’m picking it up quickly. Thank you very much!!

1 Like

If your sheet number changes in length I’d suggest splitting the whole thing at the spaces and then taking the first item as the number and reconstruct the rest as the name. It’s similar to what @jasonlkw is doing but maybe a little quicker.

1 Like

@Nick_Boyts the sheet numbers are always the same length.

So I split the numbers and names and the sheets were created…except the first one. Any ideas why??

No way to tell just by that. If you didn’t get any errors then I’d recommend “deconstructing” the custom node (by pulling out the python or nodes inside it) to get a better look at what’s happening.

Nevermind…I realized what happened. Sheet C-001 already exists with the exact same name :crazy_face:

Thank you all so much!

I was thinking of that too! So many fun ways to get to a goal :slight_smile:

On the error side, was thinking the project might have an existing sheetnumber already.

*my bad, just saw your response @lashaw13
BTW, can’t help but to notice that your sheetname strings had a prefix of space.
When you’re using String.Remove, you might want to increase (+1) on the starting index.

@jasonlkw
Thank you so very much for noticing! I increased by 3 actually so the spaces and dash were removed so when the sheets are created they look correct…C-101 - name instead of C-101 - - name

1 Like