Change titleblock failed

SO i add the List.Sort to see if the missing two sheets pop out, and yes, they do but only in the UI window, the code is still showing 120 instead of 122, and it still not changing the titleblock

What is happening is the Keys list doesn’t match the Values list. So if you look at your titleblock node, it’s returning an Empty List in the first index. When you flatten that list, the empty indexes are deleted out and that is the list you are assigning as the Values. But your keys list is still including the sheets that don’t have titleblocks. Ultimately, the sheet that you think you are selecting to change is not the actual sheet that Dynamo is seeing to change.

You need to filter out the sheets that don’t have titleblocks before you feed that into the Keys list so that it matches the Values list. BTW, be careful using the List.Sort on just part of your inputs. This will also throw off the Keys and Values list. You are sorting the sheet numbers, but not applying the same sorting method to the names and titleblocks.

TO filter the sheet/titleblock or sheet.sheetnumber?

If I understand you correctly, you’re trying to change the title block of a selected sheet to a different title block. This would require you to change the TB instance to a new FamilyType. Your latest screenshot shows the TB instance being passed correctly, but all the previous images showed you returning the FamilyType. You should be able to set the Type parameter to the FamilyType of the instance (just like you originally tried) as long as you’re changing the parameter of the instance object.

1 Like

Filter the list to remove the empties this way. Lacing of the List.IsEmpty set to longest and push the outs of the List.FilterByBoolMask to the code block. This should get all list to match in order.

image

OMG IT finally works!!! THank you so so much, greatly appreciated. I’ll create another issue that I’m also trying to use the treeview node to have the sheets organized like what it has in the project browser. Thank you again!

1 Like