วันอังคารที่ 4 มกราคม พ.ศ. 2565

Make Hidden Line.

;;make hidden line.

;;Test by AutoCAD and CADTHAI 

(defun c:mkhl ()

(setq old_cmdecho  (getvar "cmdecho"))

(setq old_osnap (getvar "osmode"))

(setvar "cmdecho" 0)

(setvar "osmode" 0)

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

(or ltl (setq ltl 5.0))

(setq ltltemp

(getdist (strcat "\nEnter Dash length :  <"

(rtos ltl 2 2)

">: "

) ;_ strcat

) ;_ getdist

) ;_ setq

(and ltltemp (setq ltl ltltemp))

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

(or ltd (setq ltd 1.0))

(setq ltdtemp

(getdist (strcat "\nEnter Spacing :  <"

(rtos ltd 2 2)

">: "

) ;_ strcat

) ;_ getdist

) ;_ setq

(and ltdtemp (setq ltd ltdtemp))

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

(while (and 

(setq pt1 (getpoint "\nPick Start Point : "))

(setq pt2 (getpoint pt1 "\nPick End Point : "))

)

    (progn


(setq dis (distance pt1 pt2)

  ang (angle pt1 pt2)

)

(repeat (setq i (fix(/ dis (+ ltl ltd))))

(setq p1 pt1

  p2 (polar p1 ang ltl) 

  p3 (polar p2 ang ltd)

)

(command "_line" p1 p2 "")

(setq pt1 p3)

        )

)

)

(setvar "cmdecho" old_cmdecho)

(setvar "osmode" old_osnap)

(princ)

)

(prompt "\nEnter MKHL to start make hidden line. ")

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

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