Why does my script make 2 elements instead of one?

Hi,

Here i am again, some people helped me allready alot. But i can’t figure out why this script creates two walls when i run it. I think it is because i create a revit element and a dynamo element. But how can i only keep the dynamo element and not create (or delete) the revit element.

And how can i send the first wall.Id to the output node?


Dynamo2
Dynamo1

Note: The wall must be created by a profile.

wallDynamo = wall.ToDSType(True)
I think you don’t need this

Thanks, But it only works ones. if i keep my revit file open and delete the walls in the file and change the dimensions and run it again, it somehow keeping the original one and adds a new one in total of two walls.

If i close and re-open the file it gives me only one wall.

But i need to make the wall parametric, so its changes alot, Someone mentioned to use wall.ToDSType(True) but that doesnt change the fact that it still creates 2 wall often, not always.

it is very confusing what is happening inside revit.

The method wall.ToDSType(True) is indicating the wall was created outside of the script, say sourced from a FilteredElementCollector or a selection, as you have created the wall in the script the preferred wrapping method would be wall.ToDSType(False)

See wrapping on the DynamoDS wiki on Github

1 Like

Yes thank you! I thought i tried that allready but apperently i mixed those vallues up. It looks like it works for now.