ConnectorElement Creation Issue

So recently, i tried playing around with connector creation in a family document and the ultimate goal is to create a connector on each nested family extrusion.

Here comes the issue, my connector is always at the origin of my family document, do any of you know why??

below is the entire code in python and the familydoc, and dynamo file:

import clr
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Import RevitAPI
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Mechanical import *
from Autodesk.Revit.DB.Plumbing import *
from Autodesk.Revit.DB.ExternalService import *
from Autodesk.Revit.DB.ExtensibleStorage import *

# Import ToDSType(bool) extension method
import Revit
# Import ToProtoType, ToRevitType geometry conversion extension methods

# Import DSCore nodes in Dynamo
import DSCore
from DSCore import *

# Import python library
import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
import os
import shutil
import math
# Import math library
from math import *

#Import Data and Time
from datetime import datetime
now =

#Import System Library
import System
from System.Collections.Generic import *
from System.IO import Directory, Path

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

geoOptions = app.Create.NewGeometryOptions();
geoOptions.View = doc.ActiveView;
geoOptions.ComputeReferences = True;

def GetFacesOfElement(ele):
	result = list()
	geoElement = ele.get_Geometry(geoOptions)
	for geoObject in geoElement:
		geoInstances = geoObject.GetInstanceGeometry()
		for sol in geoInstances:
			if sol.Faces.Size > 0: 
	return [r for r in result if type(r) == PlanarFace]
#Preparing input from dynamo to revit
pvp = ParameterValueProvider(ElementId(BuiltInParameter.IS_VISIBLE_PARAM))
fr = FilterIntegerRule(pvp, FilterNumericEquals(), 1)
epf = ElementParameterFilter(fr)

pvp1 = ParameterValueProvider(ElementId(BuiltInParameter.SYMBOL_NAME_PARAM))
fr1 = FilterStringRule(pvp1, FilterStringContains(), "Connector", False)
epf1 = ElementParameterFilter(fr1)

replica_Conns = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_GenericModel).WhereElementIsNotElementType().WherePasses(LogicalAndFilter(epf,epf1)).ToElements()

testing = list()

famManager = doc.FamilyManager
for replica_Conn in replica_Conns:
	faces = GetFacesOfElement(replica_Conn)
	_reference = faces[0].Reference
	conEle = ConnectorElement.CreateDuctConnector(doc, DuctSystemType.SupplyAir, ConnectorProfileType.Round, _reference)

#Final output
OUT = testing

ConnectorCreation.dyn (17.3 KB) TESTAHU.rfa (408 KB)

Any help is much appreciated

it would seem when you get a reference from FamilyInstance it’s the reference into the Family, but you need “convert” this reference into the actual family document (not easy)
I don’t know if a similar “CreateLinkReference()” method exist for this case.
Why not use extrusions and filtered them by offset?