Place my family instance on a linked wall

I want to place my family instance on a linked wall, its face based. the ootb node doesn’t work and python method is giving error: Warning: FamilyInstance.ByFace operation failed.
Reference from different document
Parameter name: reference
image
and I have tried doing this with python and I am getting the same error:Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 36, in
Exception: Reference from different document
Parameter name: reference

import clr
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import System
from System import Array
from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager 
from RevitServices.Transactions import TransactionManager 

clr.AddReference("RevitAPI")
import Autodesk 
from Autodesk.Revit.DB import *
from math import atan2, radians, cos, sin, degrees, sqrt, ceil

doc = DocumentManager.Instance.CurrentDBDocument
familytype = UnwrapElement(IN[0])
locations = IN[1]
faces = IN[2]
refdirections = IN[3]
hosts = UnwrapElement(IN[4] if isinstance(IN[4],list) else [IN[4]])
collector = Autodesk.Revit.DB.FilteredElementCollector(doc)
linkInstances = collector.OfClass(Autodesk.Revit.DB.RevitLinkInstance)
familyinstances = []
TransactionManager.Instance.EnsureInTransaction(doc)
for location,face,refdirection,host in zip(locations,faces,refdirections,hosts):
	for LI in linkInstances:
		familyinstance = doc.Create.NewFamilyInstance(face.Tags.LookupTag("RevitFaceReference"),location.ToXyz(True),refdirection.ToXyz(True),familytype)
		familyinstances.append(familyinstance)
# Place your code below this line
TransactionManager.Instance.TransactionTaskDone()
# Assign your output to the OUT variable.
OUT = familyinstances

Hello try to get your faces with Bimorph element faces and try spring familyinstance by face.should work

1 Like

I am selecting my linked elements from springs node select linked element and using Element.Faces node. the surfaces then constitute the input for family instance but with only the face.
If I use spring nodes instead of my python node I get null outcomes.

Try with bimorphes select linked element and bimorph element faces and spring family instance by face

will try let you know

1 Like

yes it worked, thanks @sovitek

it would have been nice if I could get what was wrong with my code

here is a problem, how would I set the direction of placement on face?