FamilyInstance.ByPoint node issues

I’ve been trying to troubleshoot a script and have identified the ‘FamilyInstance.ByPoint’ built-in node as the problem.

To prove what I’d been seeing, I created a basic script to test things and have managed to replicate the issues that I’m having.

If I use the node to create a new family instance, then it works just fine. However, when I then move the new instance of the family to another position and then re-run the script, in theory creating a new instance, then rather than creating another instance of the family, it moves the first one back to the original point…

The same thing happens using the ‘FamilyInstance.ByPointAndLevel’ built-in node and also through a code block using FamilyInstance.ByCoordiantes and .ByPoint, presumably, as they replicate the nodes?

I do not know how to explain why but here is some help:
http://dynamobim.org/forums/topic/custom-node-behavior/

I guess you already found out that if you cancel some nodes and position them again ( or even close and re-open the script) it should work as you wish.

Close and re-open the DYN

@Andrew_Casey I got this bad boy fixed :slight_smile:

Here is the code:

import clr

clr.AddReference("RevitServices")
clr.AddReference("RevitNodes")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc =  DocumentManager.Instance.CurrentDBDocument

import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *


def ptslist(obj1):
	if hasattr(obj1,"__iter__"): return obj1
	else: return [obj1]

famType = UnwrapElement(IN[0])
pts = ptslist(IN[1])
lvl = UnwrapElement(IN[2])


elems = []

for pt in pts:
	TransactionManager.Instance.EnsureInTransaction(doc)
	elems.append(doc.Create.NewFamilyInstance(pt.ToRevitType(True), famType, lvl, Structure.StructuralType.NonStructural))
	TransactionManager.Instance.TransactionTaskDone()
	
OUT = elems
1 Like