Room location Point from Linked Element

Hi all, I use a node from Archilab-net which allow me to get Element from linked file in room. The dynamo works perfectly but i would like to custom it.
By default, the script get take the family location point. Is there any way to use the Room calculation Point instead ?

i’ve try using this but without result.

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

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

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

from System.Collections.Generic import *

#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN

rvtLink = UnwrapElement(IN[2])
transform = rvtLink.GetTotalTransform()

def FamiliesInRoom(_room, _families, _transform):
	outList = []
	for family in _families:
		#pt = _transform.OfPoint(family.Location.Point) -> from the original script
		pt = family.GetSpatialElementCalculationPoint()
		if _room.IsPointInRoom(pt):
			outList.append(family)
	return outList

families = []
for i in IN[0]:
	families.append(UnwrapElement(i))

rooms = []
for i in IN[1]:
	if UnwrapElement(i).Area > 0:
		rooms.append(UnwrapElement(i))

outData = [[] for i in range(len(rooms))]
for index, room in enumerate(rooms):
	outData[index].extend(FamiliesInRoom(room, families, transform))

OUT = outData

Can someone help plz ?

thx by advance

I am unsure if this would work on a linked instance but you could try…

it doesn’t work, that 's why i need help ^^

I reformatted your code for the forum - please use the ‘preformatted text’ (```yourtexthere``` or highlight and select ‘preformatted text’ from the ‘gear’ menu) option to keep things readable in the future.

Best to share a sample data set (host rvt and the link rvt) and your current graph for these types of issues.

Thx Jacob, sorry for that.

Here is a test i’ve made. ARC is the main file where i linked the CFA.

Actually, i’ve made a test in CFA_test with just 11 elements and… it’s works !

But using the “normal” CFA files, the dynamo returns null. I don’t see any difference between the 2 files.

Here are the files i’m using: https://we.tl/t-fTzyEKIoly