HowTo: Creating View Sets From Dynamo

Good Morning All,

Is it possible to create a dynamo workflow that can obtain a list of all sheets in my project, by “SHEET_NUMBER” parameter, then look at the title block type for each sheet, then split the “SHEET_NUMBER” list by the title block type. (ie. A0, A1, Splashsheet).

Then automatically create view sets named appropriately (A1 Drawings, A0 Drawings, Splashsheet etc.).

Long story short, im trying to create view sets from sheet type parameters automatically.

Many thanks in advance for any help!!!

(Below is an example of the title block type results that i need to link to a sheet by sheet number and then somehow automatically produce the view sets based on the title block type.)

example

take a look at Springs.ViewSet.ByViewsName

1 Like

Adam, thanks for the quick response, i’ve just downloaded the latest version of spring nodes. Do you happen to have an example of how this node is used in practice?

I’m fairly new to the world of Dynamo but i’ll be looking into this node now, thanks!

Since my last post, i’ve stumbled across the workflow attached. How would i modify this to obtain the sheets filtered by the title block type (A1, A0) etc.

This workflow uses the drawing name but the drawing size obviously isn’t in the drawing name so i’ll need to find another method.

Source for workflow above: DIMITAR VENKOV: http://dynamobim.org/forums/topic/create-sheetset-from-sheet-grouping/

the image below might be a bit difficult to follow if your just starting out, but feel free to have a look,

  • all the sheets are collected
  • the cisfb parameter is found for the sheets
  • the cisfb parameter is used as a key to group the sheets
  • unique keys (cisfb parameter values) are translated using a csv file in a dictionary
  • clockwork method for replacing nulls is used (if the cisfb isn’t in the csv)
  • bit of formatting to make the text strings look like we want them to in the view set
  • springs node

you asked how to obtain sheets filtered by block type:

  • as above get a parameter value by name
  • then you could either group by key as I did above
  • or you could filter by bool mask and a conditional test

hope that helps…

1 Like

Mind blown! I’ll re-create this and try to figure out the last steps myself in order to get it to do exactly what i’m after. Many thanks Adam. I’ll drop another message if/when i figure it out!

I have recreated the workflow you’ve sent over (picture) but producing a few errors.
From left to right the errors are:

Code block 1 error message:
Warning: Sequence contains no elements.

“Python Script from string” error message:
Error1

Code block 2 error message:
Warning: String.Replace operation failed.

Post below contains the full workflow graph so you can see the error’s i’m referring to.

How have you setup the CSV file?
I’ve just created a blank csv file.

Note: When i run this workflow it does actually create a viewset of all sheets in the model and called the ViewSet “None”.

Thanks again for your help Adam.

Full View (for reference to the post above)

unless you have a parameter called “Category/Element” then you wont be getting any values
try changing it to what you want to group by

try putting some values in your csv file in the following format

value in parameter , string to use in view set

the dictionary can then, convert the values from the parameter into strings we can use in the view set name

1 Like

Hello Adam,
I’m progressing slightly :slight_smile:

I have now updated the csv to contain the following text:
A1,TEST
A2,TEST2
A3,TEST3

Then within the Sheets Revit Schedule i have input values of either A1, A2 or A3 into one of the columns.
Just for testing purposes i’ve used our “Volume Name” column (a sheet parameter “text”).

When running the workflow, dynamo now picks up these values and creates viewsets defined as one of the following ViewSets;

(A1) Drawing Set
(A2) Drawing Set
(A3) Drawing Set.

I edited the clockwork code block at the bottom from “undefined” to “drawing set” to achieve the above, should i have done that?

The problems i have with this approach is;

  1. im not sure what “string” values i should be defining in the csv, currently the second part of the CSV lines (TEST, TEST2, TEST3 etc) seem like they’re ignored. This will be my limited knowledge of strings/dynamo/coding in general.

  2. This approach requires me to add values to one of the parameters of the sheet. Ideally i need it to find the title block name of each sheet which im struggling with and its not a sheet parameter?

Thanks!

Current status of workflow attached.

Jack.

If you want to use Sheet Name as the driving parameter then you probably don’t need to use a dictionary

I was using a dictionary as I was looking at package codes, of which there will be a limited number of that it makes sense to handle in a dictionary informed by a csv. Each of my sheets had the package code value but didn’t have a description of the package code. I used the dictionary to add a description to the code, or in other words a value to a key.

If however you are looking at Sheet Name then a dictionary makes less sense as you will likely have hundreds or thousands of sheets, more than I would want to manage in a dictionary for sure. If you don’t have a dictionary then you don’t need the clock work replace nulls either…

you could simplify it by using something like the following

setName = “(” + key + “) Drawing Set”;

this should work if your Sheet Name values are the same on multiple sheets, if there not it would just create a print view set for each sheet with a unique Sheet Name

ps tip on posting to forums when you post an image it helps if you reveal the contents of each node so that anyone can see what each node has done at each step

merry christmas :christmas_tree:

3 Likes

Good Morning Adam!

Thanks for the above, this works perfectly for Sheet Name but in fact i need to use the name of the ‘Title block’ for each sheet to Group / Define the group set.

See below, i have 5 title blocks instances in use for the current project (4 types overall, there are two instances of the ‘A2’ title block):

“PEP_Splashsheet”
“A1”
“A2”
“A3”
“A2”

These relate, in order, to the sheets in my project which are:
“0210 - PEP_SPLASH”
“2000 - SHEET 1”
“2001 - SHEET 2”
“2002 - SHEET 3”
2003 - SHEET 4"

Therefore i’m trying to produce sets by the titleblock name and so the result should be;

List
0 - (PEP_Splashsheet) Drawing set, Viewset create with 1 view inside (PEP_SPLASH)
1 - (A1) Drawing set, Viewset create with 1 view inside (SHEET 1)
2 - (A2), Viewset create with 2 views inside (SHEET 2, SHEET 4)
3 - (A3), Viewset create with 1 view inside (SHEET 3)

Edit: After writing the information above, i think I’ve now almost achieved what i’d set out to do.

However, there is still one problem, how do i define the viewsets only as “PEP_Splashsheet, A1, A2, A3 etc”.
At the moment i’ve linked it to the parameter name “Type” through the code block but this returns a long string of text, like “Family Type: A2, Family: PEP_Sheet”.

I have tried using “Family Type” in the code block but it returns blank results. See my current workflow below.

… and Merry Christmas to you too!!

Dynamo workflow with all relevant information shown;

after getting the titleblock type use string from object and then substring to get just the part of the type string that you want :christmas_tree:

1 Like

It’s so very close to being spot on!

As i need to define a “length” for the ‘String.Substring’ node it means the majority of strings still contains characters i dont want. If i reduce the code block for length down to “2” then the A1, A2, A3 viewsets would be named perfectly BUT the PEP_Splashsheet would then be defined as “PE” not “PEP_Splashsheet”.

Is there another node i can use after the string.substring to refine the list by removing “, Family: PEP”, or maybe there is another approach you could suggest?

Thanks for your continued support!

Jack

you could use two different string contains and filter by bool then sub string, that should work

I’ve used a ‘String.Replace’ to get rid of the unwanted characters and now i have exactly what im after!!!
I shall leave you alone now :stuck_out_tongue:

Many thanks Adam!

1 Like

Hi, I did use workflow presented above several months ago and at that time it worked brilliantly. 2 days ago I tried it on another project and now have several observations, improvements and questions.

  1. The “List.GroupByKey” node in this workflow will do the job only if the initial list of “Sheets” and “Title Blocks” elements will match each other (first sheet on the list contains the first title block, second sheet contains second title block and so on). This node takes the first object form the list and pairs it with the first “key” (from the string of keys), same for the second object and second “key” and so on, and at the end it sorts the pairs by the keys making groups. Several months ago I didn’t notice that becouse the initial lists were in order eventhough I had about 400 sheets in my project. I don’t know what defines the order of sheets and title blocks but in the new project they don’t match. The solution I came to is pretty simple: I added a step in which I get “Sheet Name” parameters of Title blocks and sort them using these parameters as “keys”. The same is done to the Sheets. Then we can proceed as normal.

  2. The “Sheet Name” parameter can be replaced by “Sheet Number” parameter (as shown in the workflow below) as the same sheet name can occure in several sheets causing missmatches. Sheet number is a parameter that is unique and original for each sheet so it cannot repeat, On the other hand I noticed that sheets have two parameters named “Sheet Number”, and one of them is always blank. I don’t know if this can influence the workflow. I didn’t notice any malfunctions in this area so far. I suppose “Workset” parameter could also be used for sorting sheets and title blocks.

  3. The workflow is vulnerable to unequal number of sheets and title blocks (when there is a sheet without a title block in it, or sheet with 2 title blocks), and will react with warnings to such situation. However when u have one sheet without title block and one with 2 title blocks the numbers of elements and keys will match and no warnings will occure, and created sets can be incorrect. To prevent this I compared lists of “Sheet Number” parameters of title blocks and sheets with a formula and counted “false” occurances. If the number of occurances equals 0 sets are correct. If not you have to find the first “false” in the list and ispect the matching sheet (in Revit) for the number of title blocks in it. After adding the missing title block or deleting the additional one u can run the workflow again. If the problem reappears, again u have to search for the first “false” and repeat this till u get your title blocks in order - one title block per one sheet.

  4. The thing I didn’t manage to solve is replacing old view sets with new ones. If there already are view sets of the same name in the project I cannot overwrite them. Anyone got solution or explonation for that? Besides creating new names of view sets each time.

I attach my improved workflow hoping I made up for the help that I received form you :slight_smile:

Gniewko

I know this is a little late, but here are a few examples that are related to this question. http://archi-lab.net/creating-view-sets/

3 Likes

@Konrad_K_Sobon Creating a View Set automatically by current revision is a very neat idea!

I’ll try and add it as an option to my batch plot graph…

Thanks,

Mark