Cezar Barbalho Posted August 12, 2016 Author Share Posted August 12, 2016 Okay, thank you for all your help! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 14, 2016 Share Posted August 14, 2016 Hi Tharwat, it's working, but i have found a limitation on the polyline length, if i try to use a polyline longer than 100 kilometers, it freezes the program. This issue is something easy to work around? Hi Cezar, I just modified the program HERE so please try it again and let me know. Quote Link to comment Share on other sites More sharing options...
Cezar Barbalho Posted August 16, 2016 Author Share Posted August 16, 2016 Hi Tharwat, I have just tested it again and it does work on a 100 KM or + swpolyline! You have been of great help to me. On this last saturday i have been working on this project and decided to supress one of the attributes, and to put some fomating on the output text, it has worked as expected, i'll post the modifications i have done to the code so you can tell me what you think of it. I understand that the original request was for 3 attributes, not 2. But this was all i could do to work around my issue. Thanks again for your help and pacience. (SETQ km (COND ((= (SETQ lng (LENGTH (VL-STRING->LIST (RTOS d 2 0)))) 1 ) (STRCAT "000+00" (SUBSTR (RTOS d 2 0) 1 1)) ) ((= lng 2) (STRCAT "000+0" (SUBSTR (RTOS d 2 0) 1 2))) ((= lng 3) (STRCAT "000+" (SUBSTR (RTOS d 2 0) 1 3))) ((= lng 4) (STRCAT "00" (SUBSTR (RTOS d 2 0) 1 1) "+" (SUBSTR (RTOS d 2 0) 2 3) ) ) ((= lng 5) (STRCAT "0" (SUBSTR (RTOS d 2 0) 1 2) "+" (SUBSTR (RTOS d 2 0) 3 3) ) ) ((= lng 6) (STRCAT (SUBSTR (RTOS d 2 0) 1 3) "+" (SUBSTR (RTOS d 2 0) 4 3) ) ) ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 17, 2016 Share Posted August 17, 2016 You are most welcome Cezar, You can shorten your codes with the following codes. (setq d (rtos d 2 0) l "") (repeat (- 6 (strlen d)) (setq l (strcat l "0"))) (strcat (substr (strcat l d) 1 3) "+" (substr (strcat l d) 4 3)) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 17, 2016 Share Posted August 17, 2016 Alternatively: (setq d (strcat "00000" (rtos d 2 0)) l (strlen d) km (strcat (substr d (- l 5) 3) "+" (substr d (- l 2) 3)) ) Quote Link to comment Share on other sites More sharing options...
Cezar Barbalho Posted August 17, 2016 Author Share Posted August 17, 2016 Hi Tharwat and Lee Mac, I really liked yours suggestions, i am learning a lot from you Tharwat. And Lee Mac, i am a fan of your work too, it was your site that make me want to learn to do lisp, and it was Tharwat lisp code that answered my needs on my job. Thank you guys! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 17, 2016 Share Posted August 17, 2016 Happy to hear that Cezar, and you are welcome anytime. Nice approach Lee. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 17, 2016 Share Posted August 17, 2016 Thanks guys Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.