aboychuk Posted January 6, 2011 Share Posted January 6, 2011 Hi everybody. I am new to lisp, so I need your help. I have a diagram with different lines. I need to select each line separately and change a color and a line weight of it. I have one problem right now. here is the example of my selection set line (setq ssLine (ssget "X"(list (cons 0 "LWpolyline")(cons 8 "0")(cons 62 253)))) I want to keep everything the same except the last CONS (cons 62 253). I want it to take a value of a color from a object that I will select in my drawing. First, I need some command or variable to prompt me to select a line. After that, I need my selection set to change the last cons from color 222 to a color of the selected object. Thank you, AB Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 6, 2011 Share Posted January 6, 2011 Consider this example perhaps: (defun c:test ( / e ) (if (and (setq e (car (entsel "\nSelect LWPolyine: "))) (eq "LWPOLYLINE" (cdr (assoc 0 (entget e)))) ) (sssetfirst nil (ssget "_X" (list (cons 0 "LWPOLYLINE") (cons 8 "0") (cond ( (assoc 62 (entget e)) ) ( (cons 62 256) )) ) ) ) ) (princ) ) 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.