Attaching a toolpath line to an element surface

Good afternoon.

How can I bind a toolpath line to a profile?

The problem is that when moving the element along the Z axis, the selected points remain at the same level. At the same time, I meet families in which these points are displaced along with the element itself.

I understand that the problem lies in dependencies, but I have already broken my head.

This if more of an Revit question instead of Dynamo, so next time you better share this on the Revit forum. But we are here now, so do you mind sharing the family?

Maybe there is something wrong in the constraints of the geometry within the family?

Thanks for the comment, I’ll keep it in mind for the future! I am attaching the family.
It is necessary that these points be in the center of the family
Балка труба прямоугольная.rfa (372 KB)

Okay so i took a look at the family and I see a different profile then in the picture you displayed in the first post.

I also see that it is a family created using a “Line Based Generic Model” family Template in which someone later changes the category from Generic Model to Sprinkler?

The geometry looks like a Beam, so I would say this is modelled all wrong. When modelling this geometry I would advise you to use the Structural Framing Family Template. This has more flexibility, such as elevating the points at the end (as shown in your picture)

Thank you for your response! Yes, using the Structural Family really helped. Thank you!