Delete first and Place a family next in View

I have a set of families to place in the View. I wanted to delete the old ones first and then place the new ones on the view, but everytime I do that I get this error sometimes and it doesn’t work as expected:

The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone.

I have reproduced a small example to show what i am after

I think Transaction.End could solve my problem… So I referred to this link but couldn’t understand the explanation because the pictures are too small.

Can someone please explain how Transaction.End or Function.Compose works? or very specific to my problem how can one execute the nodes sequentially one after another in Dynamo?

P.S: I had an assumption that the nodes are executed in the order they are placed on the graph and that’s why this problem occurs.

@Dimitar_Venkov @Sylvester_Knudsen

Are you running in Automatic and/or are the new families also Furniture? I’m guessing you need a Wait node to force the order of operations here.

3 Likes

That would be my guess - disable automatic and add a wait for so the deletion occurs and then the families are placed.

[booleanFromElementDelete, familyTypeFromDropDown][1];

That would wire into the Family Type inout of the FamilyInstance.ByPointAndLevel node.

1 Like

I am running it in Manual mode, Also yes the families are going to be in the same category - Furniture in my example.

Could you guys explain about the wait node, I am not able to find it?

There are several implementations of it, including one in clockwork. The design script I typed above will also work - just place it in a code block (double click on the workspace) and you should be good to go.

Thank you @JacobSmall the logic you said works :slight_smile: .

I used the clockwork.passthrough node in the pic and not the code block, just so I could understand the concept well.

Cheers.