Author Topic: Match elevation  (Read 2193 times)

0 Members and 1 Guest are viewing this topic.

Dave20165

  • Guest
Match elevation
« on: December 04, 2006, 01:44:38 PM »
Does anybody have or know of a match elevation lisp?  I'm mixing topography files from multiple consultants and some have elevations while others do not.  I'd like to just be able to click one polyline, and have it assign the original elevation to any other polyline I click.  I haven't gotten into lisp programming(yet) so I wouldn't know how to make it myself.  Thanks a lot guys.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Match elevation
« Reply #1 on: December 04, 2006, 01:52:18 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Dave20165

  • Guest
Re: Match elevation
« Reply #2 on: December 04, 2006, 02:18:04 PM »
Well, in LDD we have an edit elevation command that basically does just that.  I'm just looking for something a little faster.

gile

  • Gator
  • Posts: 2520
  • Marseille, France
Re: Match elevation
« Reply #3 on: December 04, 2006, 02:35:50 PM »
Hi,

I had this one.

Code: [Select]
(defun c:match_elevation (/ ss new_elev n e_lst)
  (prompt "\nSelect polyline to get new elevation.")
  (while (not (setq ss (ssget "_:S:E" '((0 . "LWPOLYLINE")))))
    (prompt "\nNone polyline selected.")
  )
  (setq new_elev (assoc 38 (entget (ssname ss 0))))
  (prompt "\nSelect polylines to be changed.")
  (if (setq ss (setq ss (ssget '((0 . "LWPOLYLINE")))))
    (repeat (setq n (sslength ss))
      (setq e_lst (entget (ssname ss (setq n (1- n)))))
      (entmod
(subst new_elev (assoc 38 e_lst) e_lst)
      )
    )
  )
  (princ)
)
« Last Edit: December 04, 2006, 02:37:12 PM by gile »
Speaking English as a French Frog

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Match elevation
« Reply #4 on: December 05, 2006, 09:24:12 AM »
Dave did gile's routine work for you?
Or did you need something differant?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.