วันเสาร์ที่ 22 มกราคม พ.ศ. 2565

fillet radius

 

(defun c:FP (/ ss)

 ;; Alan J. Thompson, 08.31.10

(setq old_cmdecho  (getvar "cmdecho"))

(setvar "cmdecho" 0)

(initget 4)

(setvar 'filletrad

    (cond

        ((getdist (strcat "\nSpecify fillet radius <" (rtos (getvar 'filletrad)) ">: ")))

        ((getvar 'filletrad))

    )

)

(if (setq ss (ssget "_:L" '((0 . "LWPOLYLINE"))))

      ((lambda (i / e)

            (while (setq e (ssname ss (setq i (1+ i))))

                  (command "_.fillet" "_polyline" e)

            )

      )

     -1

      )

)

(princ)

(setvar "cmdecho" old_cmdecho)

)

วันอังคารที่ 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. ")