How to measure the angle of two intersecting straight lines in a assigned area through catia vba?

i want to measure the angle of two intersecting straight lines by CATIA VBA, Sometimes the measurement results are the angle of the area I want, sometimes not, without regularity. I want to know how to measure the angle of region i want. is it related to the direction of two straight lines?