I know exactly what your problem is, the start and end angles must be in radians. Besides that, path 1 must be declared as an integer at the beginning of your script and C has to be declared like this:
in your var section because C is an extended integer, use one of my DTMs as an example:
Simba Code:
if FindDTMRotated(P1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
I use my DTMs in if..then statements. It is like asking the client: "Do you see this DTM" if it sees, then you can proceed to do what you want and the coordinates of this DTM are stored in (x, y). P1 is just the name of your DTM, I used aFound instead of C but either works as long as you define either of them with the correct type, x and y also must be definted as integers so that they can be used throughout your script. This is how they are defined:
Simba Code:
var
P1, x, y: Integer;
aFound: Extended;
Good luck pal, I am going to script solely on DTMs and already know plenty about them, so if you need extra help with them, send me private message with the link to the post with the question and I'll be more than happy to go on it and post an answer as soon as possible. =)
P.S. Use 15 Tolerance for all your points in your DTM to adjust with the color changes. 15 works just perfect in my opinion: both flexible and accurate!