TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: AARYAN on May 17, 2013, 01:33:53 AM

Title: Check Error For Deg/Min/Sec
Post by: AARYAN on May 17, 2013, 01:33:53 AM
Hi All,

I am trying to creating a routine which gets the user input in DD/DM/DMS. All I want is to check the typo error which can be made by the user.
What am I approaching here is to check if the user has choosen the DD as the input then the edit_box must contain a real value with the degree symbol. Same lies for DM and DMS which must be containing the Minutes and Seconds symbol respectively.

I have already tried angtof function. Here is what i experimented with it..
(angtof "23°30'25\"" 0) --> 0.410274 ; returned value
(angtof "23°30'25\"" 1) --> 0.410274 ; returned value

Dont know why the supplied units doesnt give any error in the first expression, it should give an error when i pass the unit as 0 and string value in DMS.
Please guide me how can i do it.

Thanks and Regards
Title: Re: Check Error For Deg/Min/Sec
Post by: Russelltimk on May 17, 2013, 02:41:40 AM
I'm new myself to lisp (doing it properly at least) but I don't think the function is checking the number how you believe it is.

Check out this link for more info on the function. The number at the end is just denoting the mode.
http://help.caddit.net/progecad.php?kb=IDR_LISP_B124 (http://help.caddit.net/progecad.php?kb=IDR_LISP_B124)


This link might be useful to you for checking that the input is in the format you want to see...
http://www.cadtutor.net/forum/showthread.php?16638-LISP-requesting-user-input&s=b5544a159b6bbff2b2fa8ccad7b4ef40 (http://www.cadtutor.net/forum/showthread.php?16638-LISP-requesting-user-input&s=b5544a159b6bbff2b2fa8ccad7b4ef40)

Hope this helps!
Title: Re: Check Error For Deg/Min/Sec
Post by: AARYAN on May 17, 2013, 03:26:11 AM
Thank You So Much!!! Russelltimk..