Jump to content

layer name as elevation is it possible?


ktbjx

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)
  )

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...