ktbjx Posted October 13, 2020 Share Posted October 13, 2020 hello, is it possible to have a routine that gets the layername as elevation?? i have this LINEs (plenty of them) but they are all on different startZ and endZ and their layernames are just numbers, no strings is it possible to have a routine to get the layernames and use it as startZ and endZ of my lines? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted October 13, 2020 Share Posted October 13, 2020 Hi, That's sounds fun to write. You are talking about LINE type objects and not polylines. Right ? Quote Link to comment Share on other sites More sharing options...
ktbjx Posted October 13, 2020 Author Share Posted October 13, 2020 8 minutes ago, Tharwat said: Hi, That's sounds fun to write. You are talking about LINE type objects and not polylines. Right ? yes sir, its LINE not polyline Quote Link to comment Share on other sites More sharing options...
Tharwat Posted October 13, 2020 Share Posted October 13, 2020 Alright, Try this quickie one. (defun c:lay2elev (/ sel int ent get pos) ;; Tharwat - 13.10.2020 ;; ;; Layer name to Elevation. ;; (and (setq int -1 sel (ssget '((0 . "LINE")))) (while (setq int (1+ int) ent (ssname sel int)) (and (numberp (setq pos (distof (cdr (assoc 8 (setq get (entget ent))))))) (entmod (append get (list (cons 10 (append (mapcar '+ '(0. 0.) (cdr (assoc 10 get))) (list pos))) (cons 11 (append (mapcar '+ '(0. 0.) (cdr (assoc 11 get))) (list pos))) ) ) ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
ktbjx Posted October 13, 2020 Author Share Posted October 13, 2020 7 minutes ago, Tharwat said: Alright, Try this quickie one. (defun c:lay2elev (/ sel int ent get pos) ;; Tharwat - 13.10.2020 ;; ;; Layer name to Elevation. ;; (and (setq int -1 sel (ssget '((0 . "LINE")))) (while (setq int (1+ int) ent (ssname sel int)) (and (numberp (setq pos (distof (cdr (assoc 8 (setq get (entget ent))))))) (entmod (append get (list (cons 10 (append (mapcar '+ '(0. 0.) (cdr (assoc 10 get))) (list pos))) (cons 11 (append (mapcar '+ '(0. 0.) (cdr (assoc 11 get))) (list pos))) ) ) ) ) ) ) (princ) ) it works! wow thank you so much! this cuts my load! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted October 13, 2020 Share Posted October 13, 2020 Good for you. 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.