Jump to content
ktbjx

layer name as elevation is it possible?

Recommended Posts

ktbjx

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?

Share this post


Link to post
Share on other sites
Tharwat

Hi,

That's sounds fun to write. :) 

You are talking about LINE type objects and not polylines. Right ?

Share this post


Link to post
Share on other sites
ktbjx
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

Share this post


Link to post
Share on other sites
Tharwat

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

 

Share this post


Link to post
Share on other sites
ktbjx
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!

Share this post


Link to post
Share on other sites
Tharwat

Good for you.

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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