Hi guys.
My script to insert a family by the dwg block is not working right.
I need to run the script than modify a node like this:
to this:
than the blocks are inserted.
What sould be the problems that it doesn’t not work during the first run?
Hi guys.
My script to insert a family by the dwg block is not working right.
I need to run the script than modify a node like this:
to this:
than the blocks are inserted.
What sould be the problems that it doesn’t not work during the first run?
It would be helpful to see the rest of your graph. What are you doing beforehand? What are you doing after? What’s the reason for the Transaction nodes?
It seems like you’re placing the block and then modifying it. That’s going to require separate transactions. Currently, your transaction comes before the creation, meaning whatever modification you’re making to the new instance still happens without an instance to modify.
There’s no reason for the transaction nodes. I just put it to test cause it doesn’s affect the script.
I’ll send all the stuff.
I’m testing in 06 floor plan.
Have you tried using the transaction after the creation of the block like I suggested?
It’s way easier if you just show us what you’re doing. Most people don’t want to have to download your file and test it just to see what you’ve already done. An image is much simpler, faster, and usually all that’s needed to give you a response. It also ensures that there are no other issues that get introduced by a new user, new machine, new application versions, etc.
As @Nick_Boyts is suggesting, your transaction node is probably in the wrong location. So what is happening is that when you run the script the first time, some parts of the script are trying to do things before other actions are completed.
Example. Your script has Steps A to gather the block information and B to place the blocks. On first run, B executes before A and there is no block information for it to work with, then A gathers the block information. On the second run, A already has the block information from the previous run, so B executes correctly.
I’ve already tryed to use the transaction in all the places.
It’s always works like this:
I run the first time, than ir doesn’t works. I make any change and run the second time and it works.
Doesn’t make sense. I can just change the family type without change any node and it works.
Then as suggested to start by showing your entire graph after the first run so we can see what’s going on. BTW, you don’t have to use both transaction start and transaction end. You really only need to use one of them. I prefer using transaction end. After the transaction end, Dynamo automatically restarts and executes the nodes after the transaction.
You have multiple places where you create new elements and then either modify them or use information from them to inform other changes. Dynamo defaults to a single transaction in Revit, meaning that everything in Revit essentially happens “all at once”. That means in order to create and rotate an element, you need to create it in one transaction so that it exists in Revit for the second transaction to be able to interact with the element and rotate it.
As a starting point, you need to place a Transaction node (Start or Stop will work the same) after each node that creates a new element. You can then pass the Transaction node on to all the inputs you originally had coming from the creation node.
Could you mark on the images where do I need to place it.
I’ve tryed all the possibilities and no one works
For future reference, rather than saying “I tried and it didn’t work”, show us what you did so we can explain what went wrong or why it didn’t work. We can’t help you if you don’t show us what you’re doing and show that you’re making an effort.
You can also remove the transaction ends at the end of the script. Once a script finishes executing, that ends the entire transaction, so having those is pretty much redundant.
Just to be sure, did you close the Dynamo file and reopen it before running? Can you also record a gif of you running the script both times to get the expected outcome? And then after running the script, check to make sure you have 3 transactions showing in the Revit Undo menu rather than just one.
I always close everything before teste the changes

It just appears the points

this is what’s happen
It looks like you’re in Floor Plan 06. The elements don’t show up for me in that view. If you go to Ceiling Plan 02 you’ll see that you have hundreds of instances placed already. If you clear them all out and run the script again, they should all populate correctly.

The problem was this Ceiling Plan.
I delete it and now its working even without the trasnsactions nodes.
Thanks a lot.
I would never notice this