วันจันทร์ที่ 14 มิถุนายน พ.ศ. 2564

Change Elevation Point

;|    

      Change Elevation Point

 (+ Addend) or (- Subtrahend) Elevation Point

      Create and Design by SONGKHRAN JONGKUL June 2021

      - Enter Number + Addend or - Subtrahend

      - Select Point   

|;

(defun Change_Elevation (/ symb val ss pt assoc10 Zval newZ cntr)

(if (= tmp nil) (setq tmp "-5"))

(setq inp (getstring (strcat "\nEnter Number < " tmp " > :")))

(if (= inp "")(setq inp tmp))

(setq tmp inp)

(setq symb (substr inp 1 1))

(setq val (atof(substr inp 2 )))

(prompt "\n Select Point")

(if (or (= symb "+")(= symb "-"))

      (if (setq ss (ssget '((0 . "POINT"))))

            (progn                 

                  (setq cntr 0)

                  (while (< cntr (sslength ss))

                        (setq pt(entget(ssname ss cntr)))

                        (setq assoc10 (assoc 10 pt))

                        (setq Zval(last assoc10))

                        (setq newZ (apply (read symb) (list zval val)))

                        (entmod

                              (subst

                                    (reverse (cons newZ (cdr (reverse assoc10))))

                                    assoc10

                                    pt

                              );subst

                        ); entmod

                        (setq cntr(+ cntr 1))

                  );while

            );progn

      );if

(progn

      (Alert "Please Enter Number : (+ Addend) or (- Subtrahend) and Number")

      (Change_Elevation)

);progn

);if

(princ)

);end

(defun c:chelv ()

      (Change_Elevation)

)

(prompt "\n Change Elevation Point")

(prompt "\n Enter CHELV to Start.")


ไม่มีความคิดเห็น:

แสดงความคิดเห็น