Creating multiple family types, THEN assigning param values to them

I think I’m having trouble with sequencing. I can get this script to create all the types, but it assigns the same param values to all of them. The first set of params from the lists I have imported from Excel.

I actually want each set of param values to be assigned to the corresponding type in the types list.

(I am using the Orchid package)

How should I do that?

AP_Note Blocks_ZMASTER_Import from Excel.dyn (87.1 KB)

1 Like

Use an if statement that only works if the graph after that is succesfull, i have made a script which works in a similar way, will post a screenshot when i get home.

I am using Datastream.Await to first wait for the FamilyType.Create to finish and then make a list of the Types in the file, then it waits for that list of created types to be available, then it passes the lists for all 3 params and the list of family types into the Parameter.SetValue.

I’m getting no errors, so it seems like it’s happy with the values being passed, I’m just missing something about how it uses those lists together, I think.

All 4 lists have the same number of items, so I’d think it’d work. This visual programming is still new to me. The flow and timing doesn’t always make sense to me.

Hello @TheMattatonAP,

Have a look at this thread - it may contain what you are looking for!

Nice to hear that this works for you :slight_smile:

Sorry. I think I’m still missing something in how to connect the 4 lists I have. I’m not following how ending a transaction changes that.

Talking through it, I have the lists of values I need. The script is creating the types, so I’m good there. Now I just need to get the values assigned to the types. From what I’m assuming it’s doing. It loads up the first type and then grabs the values from the first index of each param value list. It loads up the second type and again grabs the first index from the param value lists. How do I get index 0 from the type list to grab index 0 from the param value lists, index 1 grab index 1, index 2 grab index 2 and so on?

Types Values
0-------->0
1-------->1
2-------->2

Instead of
Types Values
0-------->0
1-------->0
2-------->0

Thanks!
Matt

I updated my script with a different approach on grouping the param values before putting them into the set params node. (Based on this article: http://puntorevit.blogspot.com/2017/05/set-many-parameters-at-once-with-dynamo.html ) Everything up to the set params node works fine. I get my list of parameter names, list of param values, and list of types all set. I have a “Proceed?” check right before the set params node. If I have that set to false, the script runs and everything works. If I set that to true, the script runs for longer than I have let it continue. I usually kill it after 5 minutes or so. Just says “Run started…” and never finishes. :-/

Any ideas?

AP_Note.Blocks_ZMASTER_Import.from.Excel_Steps.dyn (92.0 KB)

Hello @TheMattatonAP,

This is a bit hard to test without a couple of things. Would you be able to provide:

  1. The AP_Anno-Tag-Note Block_Full.rfa
  2. The Excel document (I have dummy data created so this would just be to confirm)

If not - can you provide mock-ups of the data? Easier to run through and give it a go then :slight_smile:

Beyond that, you can remove one of your DesignScript blocks as it’s doing nothing:

1 Like

Of course! Thank you!
AP_Anno-Tag-Note Block_Full.rfa (300 KB)
AP_Anno-Tag-Note Block_Full-MASTER.xlsx (145.9 KB)

Are you referring to the block that limits the type name to 30 characters? Definitely want that, and it does work. That Designscript block definitely does something on my end. :slight_smile: See the last screenshot I posted.

Hi Matt,

I’ve tried to open this up but am running into errors with the custom Orchid nodes. Would you be able to please explain your intended workflow briefly?

Is it - Open up a family in the background, make changes to that family (Addition of parameters), then save that family? Do you also want to add it to the current Revit document?

Yeah, I think I’m having issues with the Orchid nodes, too. Specifically the Set Params node. Doesn’t seem to work as expected.

I want to:

  1. Open a family document in the background which would have 1 type in it, by default.
  2. Use an Excel spreadsheet to generate a list of type names, along with param values.
  3. Duplicate the existing family type based on the list of type names.
  4. Then assign the parameter values to the new types based on the lists from Excel.
  5. Close and Save the family document.
1 Like

Small update:
I shrank my sample Excel file down to just 30 or so entries (same file I linked above) to see what would happen if I let it run for a while. It did finish, but it puts in “System.Collections.ArrayList” for the param values. So, there’s still something about how I’m packaging up the param values that Parameter.SetValue isn’t liking.

So, I don’t want to say this too loud, but I think I figured it out. I’ve tested it a few times and it seems reliable.

I just had the change the lacing on the Parameter.SetValue node to longest from auto. Now it matches the indexes up properly.

2 Likes

Ah brilliant! Sorry I wasn’t more help - I’m on a mac with Parallels these days… no access to Excel on the Windows side :stuck_out_tongue:

If it becomes an issue again - revive this thread! If you can also mark your own post as solution then it can ‘close’.

1 Like