วันจันทร์ที่ 5 เมษายน พ.ศ. 2564

Elevation Line

;|

       Elevation Line

       - by : AutoLispTH@hotmail.com

|;

(defun c:ELL ()

(setq old_cmdecho  (getvar "cmdecho"))

(setq old_osnap (getvar "osmode"))

(setq old_ortho (getvar "orthomode"))

(setq old_tstyle (getvar "textstyle"))

(setq old_dimzin (getvar "dimzin"))

(setq txts (getvar "textstyle"))

(setq txth (getvar "textsize"))

(setvar "cmdecho" 0)

(setvar "osmode" 0)

(setvar "dimzin" 4)

       (or st_elv (setq st_elv 10.000));start elevation

    (setq st_elvtemp

        (getdist (strcat "\n Enter Start Elevation :  <"

                        (rtos st_elv 2 3)

                                     ">: "

                ) ;_ strcat

        ) ;_ getdist

    ) ;_ setq

       (and st_elvtemp (setq st_elv st_elvtemp))

;;----------------------------------------------

       (setq sc_y 1) ;Vertical Scale

       (setvar "osmode" 33); 1=end point 32=intersection

       (setq pt1 (getpoint "\nStart Point : "))

       (setvar "osmode" 0)

       (command "_TEXT" "BL" pt1 txth "" (strcat "+" (rtos st_elv 2 3)))

       (setvar "osmode" 33)

       (while (setq pt2 (getpoint "\nElevation Point : ")) 

              (if (>= (cadr pt2)(cadr pt1))

                     (progn

                           (setq elv (*(+ st_elv (- (cadr pt2) (cadr pt1)))sc_y))

                           (setq txt (strcat "+" (rtos elv 2 3)))

                     )

                     (progn

                           (setq elv (*(- st_elv (- (cadr pt1) (cadr pt2)))sc_y))

                           (setq txt

                                  (if (<= elv 0.000)

                                         (strcat (rtos elv 2 3))

                                         (strcat "+" (rtos elv 2 3))

                                  )

                           )

                     )

              )

              (setvar "osmode" 0)

              (command "_TEXT" "BL" pt2 txth "" txt)

              (setvar "osmode" 33); 1=end point 32=intersection

       );while

 

(setvar "cmdecho" old_cmdecho)

(setvar "osmode" old_osnap)

(setvar "orthomode" old_ortho)

(setvar "textstyle" old_tstyle)

(setvar "dimzin" old_dimzin)

(princ)

)

(prompt "\nEnter ELL to Start Elevations Line.")

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

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