you could start to check my two scripts here:
An idea of how to draw perpendicular lines, in claw example:
These scripts (in python) works with line points and perpendicular/parallel lines I think that they can be a nice beginning to face your analysis.
If you need more help, please ask.
Happy new year,
P.S.: I’ve read now that you are first experience with coding and software so maybe starting directly with python isn’t easy… if I have time I will try something easier for your problem, but I cannot swear :-/