Script deleting previously created elements


#1

Hello,

I am having trouble with a script deleting its previous’ creation every time I run the script. I want to be able to sequentially add an new incrementing number to the end of the family name each time I run the script. However, Dynamo seems to be malfunctioning since every time I run it it deletes the previous run’s element, but somehow still knows its name and then increments the number properly, but is wrong because the previous one got deleted. Does that make sense? I tried adding a passthrough node at the end of the script, just before the script is supposed to query for the highest incremental family in the model, but it doesn’t seem to work. It just calls the element “Empty” because it deleted it. How then do I accomplish my goal? Thanks,


Create floor type by filtered room name
#2

Hi,
Have you reviewed the discussion around “reconciliation” ?
This could be what you are experiencing.


#3

This is a normal function of running Dynamo for Revit in this manor. You need to either commit the elements to the model in a transaction, run the script via dynamo player instead of dynamo directly, or close the script between runs.


#4

How can I

[quote=“JacobSmall, post:3, topic:17508”]
commit the elements to the model in a transaction
[/quote]? That seems like it would be beneficial to my set up.


#5

See the link which @Ewan_Opie posted. For what it’s worth I prefer the Dynamo Player route.


#6

I concur, However this particular script has a multitude of inputs


#7

@mix Have you considered use of Data-Shapes/Spring-nodes for Dynamic Input during Player script run?


#8

No, I didnt know I could do that. Ill have to look into it. Is there a website or something?


#9

https://data-shapes.net/ :grinning:

Also, in the Dynamo Player, depending on your script formatting, the inputs may show here for end user access.


#10

Good points all @Ewan_Opie. I would like to point out that the inputs available also depend on Revit version though. :smiley:


#11

In my new project we experienced the same error, this time being in a later version of Revit I got to test the Dynamo Player solution however it didnt work! Still overwrote the previous sheets!!

Solution for now is that you have to run a random script, then open a New script… copy-paste the Dynamo you want and run. :roll_eyes:


#12

Can you post your script?


#13

its really simple, it is just creating placeholder sheets.

Each team has their own excel so we run the script one at a time. Even though the sheets are created from the placeholders the new script is renumbering them when we run the second excel for other team.


#14

How are you running this via Player? It’s not clear how you are differentiating changes in input. Post the actual dyn so I can review.


#15

CREATE_PLACEHOLDER_SHEETS.dyn (105.9 KB)

The screenshot is from Sandbox (therefore nodes unloaded) but its just to indicate the two editable parameters, I am selecting a different excel each time and also setting a sheet group e.g. “MDI ATHLETICS” or “MDI AQUATICS” etc

Even when both lists of drawings have a different count, they are overwritten.