macros55 Posted April 1 Share Posted April 1 Hi Everybody, I need a lisp, the closed polylines get new Z values from own center points. Thanks. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 1 Share Posted April 1 Explain more need say a before and after dwg. Quote Link to comment Share on other sites More sharing options...
macros55 Posted April 1 Author Share Posted April 1 Mr BIGAL, Please see the attached files. test4.dwg Quote Link to comment Share on other sites More sharing options...
robierzo Posted April 2 Share Posted April 2 (defun c:changeZ (/ c_lwp c_pt lista_coord ename n Z_pt obj_n) (prompt "\nSelect the polylines") (setvar 'nomutt 1) (setq c_lwp (ssget '((0 . "LWPOLYLINE")))) (setvar 'nomutt 0) (setq n 0) (repeat (sslength c_lwp) (setq lista_coord nil c_pt nil) (setq ename (ssname c_lwp n)) (setq obj_n (vlax-ename->vla-object ename)) (foreach el1 (entget ename) (if (= (car el1) 10) (setq lista_coord (cons (cdr el1) lista_coord))) ) (setq c_pt (ssget "_CP" lista_coord '((0 . "POINT"))));selecciona el punto (if c_pt (progn (setq Z_pt (caddr (cdr (assoc 10 (entget (ssname c_pt 0))))));obtiene la Z (vla-put-Elevation obj_n Z_pt);cambia la elevación ) ) (setq n (1+ n)) ) ) Try this code Quote Link to comment Share on other sites More sharing options...
macros55 Posted April 2 Author Share Posted April 2 Mr. Robierzo its a good job. thank you very much. 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.