Rotate family

Good morning colleagues:
I have a query, I created a routine where I insert a family in a line, but I inserted in a way which is not consistent, I need to rotate the family but I have not managed to do so, I would like to know if you can help me with this problem, I appreciate the cooperation.

Hi @jaiden.rincon
We need a little more information to bea able to offer assistance.
Could you post more of your workspace and a visual indication (sketch) of your expected result?
It is hard to tell what this needs to be from your screenshot.
What exactly isnt working, the rotation? the family placement?

Thank you for your response.
As you can see in the image, the families are overlapping, which would be wrong, and my idea is to be able to have the option to rotate the family to leave it in the right way, in the following image, I will show how I want the families to be finally.

You need to compare the Family Facing Orientation (a Vector) with the direction of setout line (also a Vector) and then set the Family Instance Rotation based on the difference in value.
Before rotation.

After rotation.