Hey guys – I am new to working in Dynamo and am trying to write a script that will create a detail item for one-line diagram that corresponds with a panel within the existing project.
The top section of blocks creates a list of each panel within the project, and the bottom section pulls the detail item and creates a duplicate of a detail item with a new name.
What I need now is to create a loop so that there is a duplicate for each item in the list. As you can probably see I tried adding a python script block (I have some experience with python but am admittedly pretty rusty) – but I am not entirely sure how to make the loop execute the Family.Type.Duplicate node.
Is the intention to have a FamilyType for each Type Name?
If you retrieve a list of the Typenames stringtext in the upper row, you should be able to feed that list into the name input of the FamilyType.ByFamilyandName node and ‘batch create’ rather than loop to duplicate.
Yes that is the intention – I reopened my code and figured out that I needed to convert the Parameter “Type Name” into a string. so I made that modification.
Unfortunately when I tried plugging the list into the Family.Type.Duplicate command, it is only creating a detail out of the first item in the list when I run the script.
Set the FamilyType.Duplicate’s lacing to longest instead of auto, that should run through your entire list of names instead of just the first item. If that doesn’t work you could also try adjusting the @ level of the ‘name’ input.