Placing line based family

This could help.

https://dictionary.dynamobim.com/#/Revit/Elements/FamilyInstance/Query/FacingOrientation

Find the location of the window. Find thevfacing orientation, rotate that vector by 90 degrees. Move the location point along the rotated vector by (1/2)*(windowWidth);. Draw a line from that point along the rotated vector by a distance of (-1)*(windowWidth);.