siyadaliek Posted July 19, 2017 Posted July 19, 2017 Sir, Could you please provide me full lisp of the followings "get the total length of the selected lines which i selected in the screen, and change the selected line's colors in to red " please display the total length in the command window so that i can copy as a text Regards Siyad Quote
Tharwat Posted July 19, 2017 Posted July 19, 2017 Hi, Give this a try and let me know. (defun c:Test ( / num sel int ent ) ;; Tharwat - Date: 19.07.2017 ;; (princ "\nSelect lines,Polylines to get lengths then to move to Red color :") (if (setq num 0. sel (ssget "_:L" '((0 . "LINE,LWPOLYLINE")))) (repeat (setq int (sslength sel)) (setq ent (ssname sel (setq int (1- int))) num (+ num (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent))) ) (entmod (append (entget ent) '((62 . 1)))) ) ) (and (< 0.0 num) (princ (strcat "\nTotal lengths: " (rtos num 2 4)))) (princ) ) (vl-load-com) Quote
Tharwat Posted July 19, 2017 Posted July 19, 2017 Now that's what I call "On Demand." Agreed. Although that I don't like to contribute on such way of addressing the thread but I feel that I have the time to write a quickie program to help the OP anyway. It would be a good idea now to have a new button in the forum entitled 'BID on This task or project' Quote
siyadaliek Posted July 19, 2017 Author Posted July 19, 2017 Thank you sir, thank you so much for your quick reply, i am out of office i will check and let you know Quote
siyadaliek Posted July 19, 2017 Author Posted July 19, 2017 Thank you sir, thank you for your time, if it is quickie program also, for me its a big thing, i can save a lot of time Agreed. Although that I don't like to contribute on such way of addressing the thread but I feel that I have the time to write a quickie program to help the OP anyway. It would be a good idea now to have a new button in the forum entitled 'BID on This task or project' Quote
siyadaliek Posted July 20, 2017 Author Posted July 20, 2017 Sir its is working perfectly. In the same lisp,insted of red colour suppose i need to change in to yellow. So where i need to edit in the lisp Thanks No problem, I am always happy to help. Quote
Tharwat Posted July 20, 2017 Posted July 20, 2017 Sir its is working perfectly. In the same lisp,insted of red colour suppose i need to change in to yellow. So where i need to edit in the lisp Thanks Excellent. Just change the number 1 to 2 like this (62 . 2) to convert to Yellow then you can increment this integer up to 256 which is equal to ByLayer. Quote
siyadaliek Posted July 23, 2017 Author Posted July 23, 2017 Its working excellent sir,i can save my time. While selection time can we add the selection in to new layer "estimate" Excellent. Just change the number 1 to 2 like this (62 . 2) to convert to Yellow then you can increment this integer up to 256 which is equal to ByLayer. Quote
Tharwat Posted July 23, 2017 Posted July 23, 2017 Its working excellent sir,i can save my time. Good to hear. While selection time can we add the selection in to new layer "estimate" Yes we can and just as the following; (entmod (append (entget ent) '([color="red"](8 . "estimate")[/color](62 . 1)))) Quote
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.