Hello,
I'm trying to connect my InstanceFamilly to my Duct
when I connect it to my end point it works fine. 🤗
but when I connect to my start point it doesn't work! ☹️
someone know how to tell me what i am not doing correctly.
see the given error
See sketch
See Program:
Dim P_Reference As Reference = Sel.PickObject(ObjectType.PointOnElement, "Eerst Punt ")
Dim P_Element As Element = Doc.GetElement(P_Reference)
Dim P_LocationCurve As LocationCurve = TryCast(P_Element.Location, LocationCurve)
Dim P_Punt As XYZ = P_LocationCurve.Curve.GetEndPoint(1)
Dim P_Vector As XYZ = P_LocationCurve.Curve.GetEndPoint(1) - P_LocationCurve.Curve.GetEndPoint(0)
Dim P_Level As Level = Doc.ActiveView.GenLevel
Dim DuctLinks As DB.Mechanical.Duct = CType(Doc.GetElement(P_Reference), Duct)
Dim P_famInstance As DB.FamilyInstance = Doc.Create.NewFamilyInstance(P_Punt, MyFamilySymbol, P_Vector, P_Level, StructuralType.NonStructural)
MesFonctions.MyFunctions.ParametreRond(Doc, P_famInstance, 250.0) '' Radius
Dim BK As DB.MEPModel = P_famInstance.MEPModel
' IF I USE THE END(1) POINT IT WORK WELL
Dim connectorLinks As DB.Connector = DuctLinks.ConnectorManager.Lookup(1)
Dim BkConnectorLinks As DB.Connector = BK.ConnectorManager.Lookup(1)
BkConnectorLinks.ConnectTo(connectorLinks)
'' IF I USE THE START(0) POINT IT DOESN'T WORK !!!!
Dim ConnectorRechts As DB.Connector = DuctLinks.ConnectorManager.Lookup(0)
Dim BkConnectorRechts As DB.Connector = BK.ConnectorManager.Lookup(0)
BkConnectorRechts.ConnectTo(ConnectorRechts)
thank you in advance
Solved! Go to Solution.
Hello,
I'm trying to connect my InstanceFamilly to my Duct
when I connect it to my end point it works fine. 🤗
but when I connect to my start point it doesn't work! ☹️
someone know how to tell me what i am not doing correctly.
see the given error
See sketch
See Program:
Dim P_Reference As Reference = Sel.PickObject(ObjectType.PointOnElement, "Eerst Punt ")
Dim P_Element As Element = Doc.GetElement(P_Reference)
Dim P_LocationCurve As LocationCurve = TryCast(P_Element.Location, LocationCurve)
Dim P_Punt As XYZ = P_LocationCurve.Curve.GetEndPoint(1)
Dim P_Vector As XYZ = P_LocationCurve.Curve.GetEndPoint(1) - P_LocationCurve.Curve.GetEndPoint(0)
Dim P_Level As Level = Doc.ActiveView.GenLevel
Dim DuctLinks As DB.Mechanical.Duct = CType(Doc.GetElement(P_Reference), Duct)
Dim P_famInstance As DB.FamilyInstance = Doc.Create.NewFamilyInstance(P_Punt, MyFamilySymbol, P_Vector, P_Level, StructuralType.NonStructural)
MesFonctions.MyFunctions.ParametreRond(Doc, P_famInstance, 250.0) '' Radius
Dim BK As DB.MEPModel = P_famInstance.MEPModel
' IF I USE THE END(1) POINT IT WORK WELL
Dim connectorLinks As DB.Connector = DuctLinks.ConnectorManager.Lookup(1)
Dim BkConnectorLinks As DB.Connector = BK.ConnectorManager.Lookup(1)
BkConnectorLinks.ConnectTo(connectorLinks)
'' IF I USE THE START(0) POINT IT DOESN'T WORK !!!!
Dim ConnectorRechts As DB.Connector = DuctLinks.ConnectorManager.Lookup(0)
Dim BkConnectorRechts As DB.Connector = BK.ConnectorManager.Lookup(0)
BkConnectorRechts.ConnectTo(ConnectorRechts)
thank you in advance
Solved! Go to Solution.
Does it work when you try it out manually in the end user interface?
Does it work when you try it out manually in the end user interface?
Hi
Manually there is no problem it works
but it looks like my error comes from the way to get the second connector of the FireDamper is not the right one! or I'm wrong?
Hi
Manually there is no problem it works
but it looks like my error comes from the way to get the second connector of the FireDamper is not the right one! or I'm wrong?
You probably cannot trust the Lookup method to reliably return the target connector.
Please use something like GetConnectorClosestTo instead:
You probably cannot trust the Lookup method to reliably return the target connector.
Please use something like GetConnectorClosestTo instead:
Thanks
Thanks
Can't find what you're looking for? Ask the community or share your knowledge.