|
(defun C:SLOT () ; V1.00
;
; Draws a long slot with rounded ends by specifying center point,
; width, overall length, and angle of slot.
;
(setq c1 (getpoint "Enter CENTER POINT of SLOT: ")
sw (getdist c1 "\nEnter WIDTH of SLOT: ")
sl (getdist c1 "\nEnter LENGTH of SLOT: ")
phi (getangle c1 "\nEnter ANGLE of SLOT: ")
dW (mapcar '- (polar c1 (+ phi (/ pi 2)) (/ sw 2)) c1) ;1/2 width vector
dL (mapcar '- (polar c1 phi (/ (- sl sw) 2)) c1) ;1/2 length vector
v1 (mapcar '+ dL (mapcar '* '(-1 -1) dW)) ; vector frm cen to p1
v3 (mapcar '+ dW dL) ; vector frm cen to p3
p1 (mapcar '+ c1 v1)
p2 (polar c1 phi (/ sl 2))
p3 (mapcar '+ c1 v3)
p4 (mapcar '- c1 v1)
p5 (polar c1 phi (/ sl -2))
p6 (mapcar '- c1 v3)
)
(setvar "cmdecho" 0)
(setq tmp (getvar "pdmode"))
(setvar "pdmode" 0)
(command "point" c1)
(command "pline" p6 p1 "A" p3 "L" p4 "A" "CL")
(setvar "pdmode" tmp)
(princ)
(princ)
)
(prompt "\nType SLOT to envoke the command") |
|