Placing element - Node remembers elemt ID

I have a function that gets selected elements from a linked file and place one of my own objects in the same place. I run the script and it works fine. All the objects I wantet have been “copied”

The same function also have filters to check if that element is already “copied” and if it is in the same place. So when I rerun the function Dynamo uses a long long time and all the elements are deleted.

I guess it is so that the node that set out the objects remembers the elements ID, so that Revit and Dynamo are syncronized. It remembers even if Dynamo and Revit are restarted. So since the node that are to place out the objects now gets no input, it deletes the element.

Is there a workaround to “reset” the node that places out the objects?

Hi Rune,
Yes there is. I think your issue is similar to this topic Dear developers of Dynamo, why is this happening? - #2 by Kulkul

Try this:

import clr
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
import Revit
# Import geometry conversion extension methods
# Import DocumentManager and TransactionManager
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument

a = UnwrapElement(IN[0])
pts = IN[1]
c = []
d = []
for i in pts:

for i in c:
	fi = doc.Create.NewFamilyInstance(i,a,Autodesk.Revit.DB.Structure.StructuralType.NonStructural)
#Assign your output to the OUT variable.
OUT = d

I think that worked perfectly:)