Aligning of Cogo Lables to specific 3D Polylines or Feature lines

Dear Community,
since hours I try to figure out, how to align all CoGo-Lables to the selected 3D-Polyline.
My code includes the selection of CoGO-Group and the polyline object, creation of vectors and angles in cogo points.
I would like to alingn the lables with the lines, o which they are located.
Somehow I get always a wrong list of vectors.
Please help.
Script and DWG are allocated here: (Microsoft OneDrive)
Regards
Levon