Running Dynamo 2.0.1 causes loss of elements

Running Dynamo 2.0.1 causes loss of elements

Frans.Hessels
Advocate Advocate
2,245 Views
3 Replies
Message 1 of 4

Running Dynamo 2.0.1 causes loss of elements

Frans.Hessels
Advocate
Advocate

In AutoCAD 2019 did a Data Extraction to generate a Excel file with Center x, Center Y, Center Z data.

In Revit 2019 opened my file that stands at WCS and Run Dynamo 2.0.1 to place foundation piles of one type.

Clicked the dynamo file away and the piles show up without the blue dot. 

Opened an other Dynamo file and run it to place a second type of foundation piles.

Now some of the first placed piles disappear. Even sometimes all the piles placed first disappear.

 

What do I have to do to keep the elements placed by Dynamo in my Revit model ore is there something wrong in my code?

Revit2019-Dynamo201-1.jpgRevit2019-Dynamo201-2.jpgRevit2019-Dynamo201-3.jpg

0 Likes
Accepted solutions (1)
2,246 Views
3 Replies
Replies (3)
Message 2 of 4

L.Maas
Mentor
Mentor
Accepted solution

The issue here is probably a commit. I will try to explain. What happens behind the scenes is called a transaction. You send a series of commands (your script). Then you will see the changes. However these are preliminary. What needs to happen is that it is concluded with a commit. Only then will it be added to the project (i.e. revit database). What (I expect) happens in your case  is that you execute the command, then opens a new script and run that script. However the commands were not yet committed. When your run the new script the old command (transaction) is discarded and your new script is executed. So you need to find a solution to commit your first transaction before starting the next.

 

Here are possible solution.

-See if closing and opening dynamo between the two scripts solves the issue.

-Incorporate transaction.start and transaction.end nodes (can be tricky to make it work)

-Add code to the script to  start and end the transaction.

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

Message 3 of 4

Frans.Hessels
Advocate
Advocate

Louis Maas, thank you for your reply.

 

Closing Dynamo between two scrips I have tried but gave no solution.

So now I added the Transaction.End node to my script.

Didn't know it was there because I am a novice in handling Dynamo so I appreciate your info.

 Revit2019-Dynamo201-4.jpg

So far so good now in conjunction with closing and reopening the script every time after Run.

 

 

0 Likes
Message 4 of 4

Frans.Hessels
Advocate
Advocate

Started Revit and opened the model. Opened Dynamo end ran my script. And gone are the piles I put in as last yesterday. Now I have made a simple script with only the Transaction.start and the Transaction.end nodes.

I first run the full script. Piles are placed and blue dots appear at XYZ points of placement.

Then I close the script without saving it. The blue dots disappear.

After this I run the simple script.

Open the full script again and do the procedure again with an other pile family and Excel file.

It seems to work now.