Академический Документы
Профессиональный Документы
Культура Документы
(if (not (and (equal (getvar "ucsorg") (list 0.0 0.0 0.0))
(equal (getvar "ucsxdir") (list 1.0 0.0 0.0))
(equal (getvar "ucsydir") (list 0.0 1.0 0.0))))
(progn (alert "You must be in the World UCS to use this program")
(quit)))
(defun @BLOCK ()
(entmake '((0 . "ENDBLK")))
(entmake (list '(0 . "BLOCK") '(2 . "*XXX") '(70 . 1) '(10 0 0 0))))
(defun @POLYARC (%PT1 %PT2 %PT3 / #1-2 #2-3 #ANG1-2 #ANG2-3 #END
#MID #PROJ1 #PROJ2 #PT0 #START)
(setq #ANG1-2 (angle %PT1 %PT2)
#ANG2-3 (angle %PT2 %PT3)
#1-2 (polar %PT1 #ANG1-2 (* 0.5 (distance %PT1 %PT2)))
#2-3 (polar %PT2 #ANG2-3 (* 0.5 (distance %PT2 %PT3)))
#PROJ1 (polar #1-2 (+ #ANG1-2 (* 0.5 pi)) 1.0)
#PROJ2 (polar #2-3 (+ #ANG2-3 (* 0.5 pi)) 1.0)
#PT0 (inters #1-2 #PROJ1 #2-3 #PROJ2 nil)
#START (angle #PT0 %PT1)
#MID (angle #PT0 %PT2)
#END (angle #PT0 %PT3))
(if (or (and (< #START #END) (or (> #MID #END) (< #MID #START)))
(and (< #MID #START) (> #MID #END)))
(setq #START #END #END (angle #PT0 %PT1)))
(@ARC #PT0 (distance #PT0 %PT1) #START #END))
(setvar "cmdecho" 0)
(setq #DCL-FILE (vl-filename-mktemp "2Dgear.dcl")
#FILE (open #DCL-FILE "w"))
(foreach #X #DCL-LIST (write-line #X #FILE))
(close #FILE)
(if (< (setq #DCL-ID (load_dialog #DCL-FILE)) 0)
(progn
(alert "\nCan't load DCL file.")
(quit))
(vl-file-delete #DCL-FILE))
(if (not (new_dialog "gear2d" #DCL-ID)) (quit))
(set_tile "pang" "20")
(start_list "pitch_pop")
(foreach #X #PITCHLIST
(add_list (vl-string-right-trim "." (vl-string-right-trim "0" (rtos #X)))))
(end_list)
(set_tile "pitch_pop" (itoa (vl-position #PITCH #PITCHLIST)))
(@TEETH "12")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cadalog" "(done_dialog 2)")
(action_tile "help" "(alert #HELP)")
(action_tile "pang" "(@PANG $value)")
(action_tile "pitch_pop" "(setq #PITCH (nth (atoi $value) #PITCHLIST))")
(action_tile "prec" "(setq #PREC (atoi $value))")
(action_tile "teeth" "(@TEETH $value)")
(action_tile "teeth_minus" "(@TEETH (itoa (1- #TEETH)))")
(action_tile "teeth_plus" "(@TEETH (itoa (1+ #TEETH)))")
(setq #GO (start_dialog))
(cond
((= #GO 1) (@GEAR-DRAW))
((= #GO 2) (command "_.browser" "www.cadalog.com")))
(princ))
(princ)