Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Member
Lab_Rat
Posts: 7
Registered: ‎06-29-2011
Message 1 of 1 (291 Views)

Problem with LISP program inserting custom tapped holes onto surfaces

291 Views, 0 Replies
09-21-2011 01:19 PM

Hey all,

 

 

I am having some trouble with a program that generates different tapped holes.  When I try to place them on a part in 3D AutoCAD it only works occasionally.  I believe that it has something to do with the UCS.  I'd ideally have the ability to select the face and then drop the tap into the model but have not figured this out yet.  I have searched through many articles and there hasn’t been a solution to fix it yet.

I have attached the code.   If you have any suggestions please let me know.

 

Thanks!

 

;Setup

(defun c:JakeTap (/ tapsize ip p1 p2 p3 p4 p5 ipTp1 p1Tp2 p3Tp4 p4Tp5 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 rev1)        ;Change c:xxxxxxx to correct variable
  (setq oldos (getvar "osnapcoord"))
  (setvar "osnapcoord" 1)
  (setvar "cmdecho" 0)      ;Debug=1 Finished=0 Allows user to see steps in the command line
  (setq oldblipmode (getvar "blipmode"))
  (setvar "blipmode" 0)
  (command ".undo" "begin")
  ;(command ".ucs" "world")
  ;(command "_.ucs" "face" pause)


  
;                                                                                                                                   

; Set Hole Type                           


  (initget 1 "4-40 8-32 10-32 1-4-20 5-16-18 3-8-16 7-16-14 1-2-13 5-8-11 3-4-10")
  (setq tapsize (getkword "\n Tap Size: [4-40/8-32/10-32/1-4-20/5-16-18/3-8-16/7-16-14/1-2-13/5-8-11/3-4-10]: "))

  
; Sizes of Taps                            
  

(cond ; Start Conditional Statement        
  
; #4
  ((= tapsize "4-40")
  (setq ipTp1 0.0445)
  (setq p1Tp2 0.0242)
  (setq p3Tp4 0.1250)
  (setq p4Tp5 0.0519)
  (setq tooth 0.0157))

; #8
  ((= tapsize "8-32")
  (setq ipTp1 0.0680)
  (setq p1Tp2 0.0299)
  (setq p3Tp4 0.1560)
  (setq p4Tp5 0.0793)
  (setq tooth 0.0192))

; #10
  ((= tapsize "10-32")
  (setq ipTp1 0.0795)
  (setq p1Tp2 0.0188)
  (setq p3Tp4 0.1560)
  (setq p4Tp5 0.0927)
  (setq tooth 0.0213))

; 1/4-20  
  ((= tapsize "1-4-20")   
  (setq ipTp1 0.1005)
  (setq p1Tp2 0.0100)
  (setq p3Tp4 0.2500)
  (setq p4Tp5 0.1172)
  (setq tooth 0.0346))

; 5/16-18  
  ((= tapsize "5-16-18")   
  (setq ipTp1 0.1285)
  (setq p1Tp2 0.0145)
  (setq p3Tp4 0.2780)
  (setq p4Tp5 0.1499)
  (setq tooth 0.0392))

; 3/8-16   
  ((= tapsize "3-8-16")  
  (setq ipTp1 0.1563)
  (setq p1Tp2 0.0625)
  (setq p3Tp4 0.3130)
  (setq p4Tp5 0.1823)
  (setq tooth 0.0442))

; 7/16-14  
  ((= tapsize "7-16-14") 
  (setq ipTp1 0.1790)
  (setq p1Tp2 0.0795)
  (setq p3Tp4 0.3570)
  (setq p4Tp5 0.2088)
  (setq tooth 0.0562))

; 1/2-13  
  ((= tapsize "1-2-13")
  (setq ipTp1 0.2110)
  (setq p1Tp2 0.0628)
  (setq p3Tp4 0.3850)
  (setq p4Tp5 0.2461)
  (setq tooth 0.0552))

; 5/8-11  
  ((= tapsize "5-8-11")
  (setq ipTp1 0.2656)
  (setq p1Tp2 0.0306)
  (setq p3Tp4 0.4550)
  (setq p4Tp5 0.3099)
  (setq tooth 0.0663))

; 3/4-10 
  ((= tapsize "3-4-10")
  (setq ipTp1 0.3203)
  (setq p1Tp2 0.0778)
  (setq p3Tp4 0.5000)
  (setq p4Tp5 0.3737)
  (setq tooth 0.0774))

); End Conditional Statement                

(while  ; Begin multiple insertion points   

; Get insertion point                       

  (setq ip (getpoint "\nInsertion Point: "))

  (setq ipx  (car ip))

; Draw Taps                                  

  
(cond   ; Start Conditional Statement
  
; #4
((= tapsize "4-40")  
(setq p1  (polar ip (dtr 0.0) ipTp1))
(setq p2  (polar p1 (dtr 270.0) p1Tp2))
(setq t1  (polar p2 (dtr 315.0) tooth))
(setq t2  (polar t1 (dtr 225.0) tooth))
(setq t3  (polar t2 (dtr 315.0) tooth))
(setq t4  (polar t3 (dtr 225.0) tooth))
(setq t5  (polar t4 (dtr 315.0) tooth))
(setq t6  (polar t5 (dtr 225.0) tooth))
(setq t7  (polar t6 (dtr 315.0) tooth))
(setq t8  (polar t7 (dtr 225.0) tooth))  
(setq t9  (polar t8 (dtr 315.0) tooth))
(setq t10  (polar t9 (dtr 225.0) tooth))
(setq t11  (polar t10 (dtr 315.0) tooth))
(setq t12  (polar t11 (dtr 225.0) tooth))  
(setq t13  (polar t12 (dtr 315.0) tooth))
(setq t14  (polar t13 (dtr 225.0) tooth))
(setq t15  (polar t14 (dtr 315.0) tooth))
(setq t16  (polar t15 (dtr 225.0) tooth))
(setq t17  (polar t16 (dtr 315.0) tooth))
(setq p3  (polar t17 (dtr 225.0) tooth))
(setq p4  (polar p3 (dtr 270.0) p3Tp4))
(setq p5  (polar p4 (dtr 211) p4Tp5))

(setq p5y  (car(cdr p5)))
(setq p5  (list ipx p5y))
 
(command ".pline" ip p1 p2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 p3 p4 p5 "close")
(command ".revolve" (entlast) "" ip p5 360))


; #8
((= tapsize "8-32")  
(setq p1  (polar ip (dtr 0.0) ipTp1))
(setq p2  (polar p1 (dtr 270.0) p1Tp2))
(setq t1  (polar p2 (dtr 315.0) tooth))
(setq t2  (polar t1 (dtr 225.0) tooth))
(setq t3  (polar t2 (dtr 315.0) tooth))
(setq t4  (polar t3 (dtr 225.0) tooth))
(setq t5  (polar t4 (dtr 315.0) tooth))
(setq t6  (polar t5 (dtr 225.0) tooth))
(setq t7  (polar t6 (dtr 315.0) tooth))
(setq t8  (polar t7 (dtr 225.0) tooth))  
(setq t9  (polar t8 (dtr 315.0) tooth))
(setq t10  (polar t9 (dtr 225.0) tooth))
(setq t11  (polar t10 (dtr 315.0) tooth))
(setq t12  (polar t11 (dtr 225.0) tooth))  
(setq t13  (polar t12 (dtr 315.0) tooth))
(setq t14  (polar t13 (dtr 225.0) tooth))
(setq t15  (polar t14 (dtr 315.0) tooth))
(setq t16  (polar t15 (dtr 225.0) tooth))
(setq t17  (polar t16 (dtr 315.0) tooth))
(setq t18  (polar t17 (dtr 225.0) tooth))

(setq t19  (polar t18 (dtr 315.0) tooth))
(setq t20  (polar t19 (dtr 225.0) tooth))
(setq t21  (polar t20 (dtr 315.0) tooth))
(setq p3  (polar t21 (dtr 225.0) tooth))
 
(setq p4  (polar p3 (dtr 270.0) p3Tp4))
(setq p5  (polar p4 (dtr 211) p4Tp5))

(setq p5y  (car(cdr p5)))
(setq p5  (list ipx p5y))
 
(command ".pline" ip p1 p2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 p3 p4 p5 "close")
 
(command ".revolve" (entlast) "" ip p5 360))


; #10
((= tapsize "10-32")  
(setq p1  (polar ip (dtr 0.0) ipTp1))
(setq p2  (polar p1 (dtr 270.0) p1Tp2))
(setq t1  (polar p2 (dtr 315.0) tooth))
(setq t2  (polar t1 (dtr 225.0) tooth))
(setq t3  (polar t2 (dtr 315.0) tooth))
(setq t4  (polar t3 (dtr 225.0) tooth))
(setq t5  (polar t4 (dtr 315.0) tooth))
(setq t6  (polar t5 (dtr 225.0) tooth))
(setq t7  (polar t6 (dtr 315.0) tooth))
(setq t8  (polar t7 (dtr 225.0) tooth))  
(setq t9  (polar t8 (dtr 315.0) tooth))
(setq t10  (polar t9 (dtr 225.0) tooth))
(setq t11  (polar t10 (dtr 315.0) tooth))
(setq t12  (polar t11 (dtr 225.0) tooth))  
(setq t13  (polar t12 (dtr 315.0) tooth))
(setq t14  (polar t13 (dtr 225.0) tooth))
(setq t15  (polar t14 (dtr 315.0) tooth))
(setq t16  (polar t15 (dtr 225.0) tooth))
(setq t17  (polar t16 (dtr 315.0) tooth))
(setq t18  (polar t17 (dtr 225.0) tooth))

(setq t19  (polar t18 (dtr 315.0) tooth))
(setq t20  (polar t19 (dtr 225.0) tooth))
(setq t21  (polar t20 (dtr 315.0) tooth))
(setq t22  (polar t21 (dtr 225.0) tooth))
(setq t23  (polar t22 (dtr 315.0) tooth))
(setq p3  (polar t23 (dtr 225.0) tooth))
 
(setq p4  (polar p3 (dtr 270.0) p3Tp4))
(setq p5  (polar p4 (dtr 211) p4Tp5))

(setq p5y  (car(cdr p5)))
(setq p5  (list ipx p5y))
 
(command ".pline" ip p1 p2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 p3 p4 p5 "close")
(command ".revolve" (entlast) "" ip p5 360))


; 1/4-20
((= tapsize "1-4-20")  
(setq p1  (polar ip (dtr 0.0) ipTp1))
(setq p2  (polar p1 (dtr 270.0) p1Tp2))
(setq t1  (polar p2 (dtr 315.0) tooth))
(setq t2  (polar t1 (dtr 225.0) tooth))
(setq t3  (polar t2 (dtr 315.0) tooth))
(setq t4  (polar t3 (dtr 225.0) tooth))
(setq t5  (polar t4 (dtr 315.0) tooth))
(setq t6  (polar t5 (dtr 225.0) tooth))
(setq t7  (polar t6 (dtr 315.0) tooth))
(setq t8  (polar t7 (dtr 225.0) tooth))  
(setq t9  (polar t8 (dtr 315.0) tooth))
(setq t10  (polar t9 (dtr 225.0) tooth))
(setq t11  (polar t10 (dtr 315.0) tooth))
(setq t12  (polar t11 (dtr 225.0) tooth))  
(setq t13  (polar t12 (dtr 315.0) tooth))
(setq t14  (polar t13 (dtr 225.0) tooth))
(setq t15  (polar t14 (dtr 315.0) tooth))
(setq t16  (polar t15 (dtr 225.0) tooth))
(setq t17  (polar t16 (dtr 315.0) tooth))
(setq t18  (polar t17 (dtr 225.0) tooth))

(setq t19  (polar t18 (dtr 315.0) tooth))
(setq p3  (polar t19 (dtr 225.0) tooth))
 
(setq p4  (polar p3 (dtr 270.0) p3Tp4))
(setq p5  (polar p4 (dtr 211) p4Tp5))

(setq p5y  (car(cdr p5)))
(setq p5  (list ipx p5y))
 
(command ".pline" ip p1 p2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 p3 p4 p5 "close")
(command ".revolve" (entlast) "" ip p5 360))


; 5/16-18
((= tapsize "5-16-18")  
(setq p1  (polar ip (dtr 0.0) ipTp1))
(setq p2  (polar p1 (dtr 270.0) p1Tp2))
(setq t1  (polar p2 (dtr 315.0) tooth))
(setq t2  (polar t1 (dtr 225.0) tooth))
(setq t3  (polar t2 (dtr 315.0) tooth))
(setq t4  (polar t3 (dtr 225.0) tooth))
(setq t5  (polar t4 (dtr 315.0) tooth))
(setq t6  (polar t5 (dtr 225.0) tooth))
(setq t7  (polar t6 (dtr 315.0) tooth))
(setq t8  (polar t7 (dtr 225.0) tooth))  
(setq t9  (polar t8 (dtr 315.0) tooth))
(setq t10  (polar t9 (dtr 225.0) tooth))
(setq t11  (polar t10 (dtr 315.0) tooth))
(setq t12  (polar t11 (dtr 225.0) tooth))  
(setq t13  (polar t12 (dtr 315.0) tooth))
(setq t14  (polar t13 (dtr 225.0) tooth))
(setq t15  (polar t14 (dtr 315.0) tooth))
(setq t16  (polar t15 (dtr 225.0) tooth))
(setq t17  (polar t16 (dtr 315.0) tooth))
(setq t18  (polar t17 (dtr 225.0) tooth))

(setq t19  (polar t18 (dtr 315.0) tooth))
(setq t20  (polar t19 (dtr 225.0) tooth))
(setq t21  (polar t20 (dtr 315.0) tooth))
(setq p3  (polar t21 (dtr 225.0) tooth))
 
(setq p4  (polar p3 (dtr 270.0) p3Tp4))
(setq p5  (polar p4 (dtr 211) p4Tp5))

(setq p5y  (car(cdr p5)))
(setq p5  (list ipx p5y))
 
(command ".pline" ip p1 p2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 p3 p4 p5 "close")
(command ".revolve" (entlast) "" ip p5 360))


; 3/8-16
((= tapsize "3-8-16")  
(setq p1  (polar ip (dtr 0.0) ipTp1))
(setq p2  (polar p1 (dtr 270.0) p1Tp2))
(setq t1  (polar p2 (dtr 315.0) tooth))
(setq t2  (polar t1 (dtr 225.0) tooth))
(setq t3  (polar t2 (dtr 315.0) tooth))
(setq t4  (polar t3 (dtr 225.0) tooth))
(setq t5  (polar t4 (dtr 315.0) tooth))
(setq t6  (polar t5 (dtr 225.0) tooth))
(setq t7  (polar t6 (dtr 315.0) tooth))
(setq t8  (polar t7 (dtr 225.0) tooth))  
(setq t9  (polar t8 (dtr 315.0) tooth))
(setq t10  (polar t9 (dtr 225.0) tooth))
(setq t11  (polar t10 (dtr 315.0) tooth))
(setq t12  (polar t11 (dtr 225.0) tooth))  
(setq t13  (polar t12 (dtr 315.0) tooth))
(setq t14  (polar t13 (dtr 225.0) tooth))
(setq t15  (polar t14 (dtr 315.0) tooth))
(setq t16  (polar t15 (dtr 225.0) tooth))
(setq t17  (polar t16 (dtr 315.0) tooth))
(setq t18  (polar t17 (dtr 225.0) tooth))

(setq t19  (polar t18 (dtr 315.0) tooth))
(setq t20  (polar t19 (dtr 225.0) tooth))
(setq t21  (polar t20 (dtr 315.0) tooth))
(setq p3  (polar t21 (dtr 225.0) tooth))
 
(setq p4  (polar p3 (dtr 270.0) p3Tp4))
(setq p5  (polar p4 (dtr 211) p4Tp5))

(setq p5y  (car(cdr p5)))
(setq p5  (list ipx p5y))
 
(command ".pline" ip p1 p2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 p3 p4 p5 "close")
(command ".revolve" (entlast) "" ip p5 360))



; 7/16-14
((= tapsize "7-16-14")  
(setq p1  (polar ip (dtr 0.0) ipTp1))
(setq p2  (polar p1 (dtr 270.0) p1Tp2))
(setq t1  (polar p2 (dtr 315.0) tooth))
(setq t2  (polar t1 (dtr 225.0) tooth))
(setq t3  (polar t2 (dtr 315.0) tooth))
(setq t4  (polar t3 (dtr 225.0) tooth))
(setq t5  (polar t4 (dtr 315.0) tooth))
(setq t6  (polar t5 (dtr 225.0) tooth))
(setq t7  (polar t6 (dtr 315.0) tooth))
(setq t8  (polar t7 (dtr 225.0) tooth))  
(setq t9  (polar t8 (dtr 315.0) tooth))
(setq t10  (polar t9 (dtr 225.0) tooth))
(setq t11  (polar t10 (dtr 315.0) tooth))
(setq t12  (polar t11 (dtr 225.0) tooth))  
(setq t13  (polar t12 (dtr 315.0) tooth))
(setq t14  (polar t13 (dtr 225.0) tooth))
(setq t15  (polar t14 (dtr 315.0) tooth))
(setq t16  (polar t15 (dtr 225.0) tooth))
(setq t17  (polar t16 (dtr 315.0) tooth))
(setq t18  (polar t17 (dtr 225.0) tooth))

(setq t19  (polar t18 (dtr 315.0) tooth))
(setq p3  (polar t19 (dtr 225.0) tooth))
 
(setq p4  (polar p3 (dtr 270.0) p3Tp4))
(setq p5  (polar p4 (dtr 211) p4Tp5))

(setq p5y  (car(cdr p5)))
(setq p5  (list ipx p5y))
 
(command ".pline" ip p1 p2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 p3 p4 p5 "close")
(command ".revolve" (entlast) "" ip p5 360))



; 1/2-13
((= tapsize "1-2-13")  
(setq p1  (polar ip (dtr 0.0) ipTp1))
(setq p2  (polar p1 (dtr 270.0) p1Tp2))
(setq t1  (polar p2 (dtr 315.0) tooth))
(setq t2  (polar t1 (dtr 225.0) tooth))
(setq t3  (polar t2 (dtr 315.0) tooth))
(setq t4  (polar t3 (dtr 225.0) tooth))
(setq t5  (polar t4 (dtr 315.0) tooth))
(setq t6  (polar t5 (dtr 225.0) tooth))
(setq t7  (polar t6 (dtr 315.0) tooth))
(setq t8  (polar t7 (dtr 225.0) tooth))  
(setq t9  (polar t8 (dtr 315.0) tooth))
(setq t10  (polar t9 (dtr 225.0) tooth))
(setq t11  (polar t10 (dtr 315.0) tooth))
(setq t12  (polar t11 (dtr 225.0) tooth))  
(setq t13  (polar t12 (dtr 315.0) tooth))
(setq t14  (polar t13 (dtr 225.0) tooth))
(setq t15  (polar t14 (dtr 315.0) tooth))
(setq t16  (polar t15 (dtr 225.0) tooth))
(setq t17  (polar t16 (dtr 315.0) tooth))
(setq t18  (polar t17 (dtr 225.0) tooth))

(setq t19  (polar t18 (dtr 315.0) tooth))
(setq t20  (polar t19 (dtr 225.0) tooth))
(setq t21  (polar t20 (dtr 315.0) tooth))
(setq t22  (polar t21 (dtr 225.0) tooth))
(setq t23  (polar t22 (dtr 315.0) tooth))
(setq p3  (polar t23 (dtr 225.0) tooth))
 
(setq p4  (polar p3 (dtr 270.0) p3Tp4))
(setq p5  (polar p4 (dtr 211) p4Tp5))

(setq p5y  (car(cdr p5)))
(setq p5  (list ipx p5y))
 
(command ".pline" ip p1 p2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 p3 p4 p5 "close")
(command ".revolve" (entlast) "" ip p5 360))



; 5/8-11
((= tapsize "5-8-11")  
(setq p1  (polar ip (dtr 0.0) ipTp1))
(setq p2  (polar p1 (dtr 270.0) p1Tp2))
(setq t1  (polar p2 (dtr 315.0) tooth))
(setq t2  (polar t1 (dtr 225.0) tooth))
(setq t3  (polar t2 (dtr 315.0) tooth))
(setq t4  (polar t3 (dtr 225.0) tooth))
(setq t5  (polar t4 (dtr 315.0) tooth))
(setq t6  (polar t5 (dtr 225.0) tooth))
(setq t7  (polar t6 (dtr 315.0) tooth))
(setq t8  (polar t7 (dtr 225.0) tooth))  
(setq t9  (polar t8 (dtr 315.0) tooth))
(setq t10  (polar t9 (dtr 225.0) tooth))
(setq t11  (polar t10 (dtr 315.0) tooth))
(setq t12  (polar t11 (dtr 225.0) tooth))  
(setq t13  (polar t12 (dtr 315.0) tooth))
(setq t14  (polar t13 (dtr 225.0) tooth))
(setq t15  (polar t14 (dtr 315.0) tooth))
(setq t16  (polar t15 (dtr 225.0) tooth))
(setq t17  (polar t16 (dtr 315.0) tooth))
(setq t18  (polar t17 (dtr 225.0) tooth))

(setq t19  (polar t18 (dtr 315.0) tooth))
(setq t20  (polar t19 (dtr 225.0) tooth))
(setq t21  (polar t20 (dtr 315.0) tooth))
(setq t22  (polar t21 (dtr 225.0) tooth))
(setq t23  (polar t22 (dtr 315.0) tooth))
(setq t24  (polar t23 (dtr 225.0) tooth))
(setq t25  (polar t24 (dtr 315.0) tooth))
(setq p3  (polar t25 (dtr 225.0) tooth))
 
(setq p4  (polar p3 (dtr 270.0) p3Tp4))
(setq p5  (polar p4 (dtr 211) p4Tp5))

(setq p5y  (car(cdr p5)))
(setq p5  (list ipx p5y))
 
(command ".pline" ip p1 p2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 p3 p4 p5 "close")
(command ".revolve" (entlast) "" ip p5 360))



; 3/4-10
((= tapsize "3-4-10")
(setq p1  (polar ip (dtr 0.0) ipTp1))
(setq p2  (polar p1 (dtr 270.0) p1Tp2))
(setq t1  (polar p2 (dtr 315.0) tooth))
(setq t2  (polar t1 (dtr 225.0) tooth))
(setq t3  (polar t2 (dtr 315.0) tooth))
(setq t4  (polar t3 (dtr 225.0) tooth))
(setq t5  (polar t4 (dtr 315.0) tooth))
(setq t6  (polar t5 (dtr 225.0) tooth))
(setq t7  (polar t6 (dtr 315.0) tooth))
(setq t8  (polar t7 (dtr 225.0) tooth))  
(setq t9  (polar t8 (dtr 315.0) tooth))
(setq t10  (polar t9 (dtr 225.0) tooth))
(setq t11  (polar t10 (dtr 315.0) tooth))
(setq t12  (polar t11 (dtr 225.0) tooth))  
(setq t13  (polar t12 (dtr 315.0) tooth))
(setq t14  (polar t13 (dtr 225.0) tooth))
(setq t15  (polar t14 (dtr 315.0) tooth))
(setq t16  (polar t15 (dtr 225.0) tooth))
(setq t17  (polar t16 (dtr 315.0) tooth))
(setq t18  (polar t17 (dtr 225.0) tooth))

(setq t19  (polar t18 (dtr 315.0) tooth))
(setq t20  (polar t19 (dtr 225.0) tooth))
(setq t21  (polar t20 (dtr 315.0) tooth))
(setq t22  (polar t21 (dtr 225.0) tooth))
(setq t23  (polar t22 (dtr 315.0) tooth))
(setq t24  (polar t23 (dtr 225.0) tooth))
(setq t25  (polar t24 (dtr 315.0) tooth))
(setq p3  (polar t25 (dtr 225.0) tooth))
 
(setq p4  (polar p3 (dtr 270.0) p3Tp4))
(setq p5  (polar p4 (dtr 211) p4Tp5))
 
(setq p5y  (car(cdr p5)))
(setq p5  (list ipx p5y))
 
(command ".pline" ip p1 p2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 p3 p4 p5 "close")
(command ".revolve" (entlast) "" ip p5 360))


) ; End Conditional Statement

) ; End While                               

;                                                                                                                                      

;Cleanup                                    

  (setvar "osnapcoord" oldos)
  (setvar "cmdecho" 1)
  (command ".undo" "end")

  (princ)  ; Clear
)

; Convert degrees to radians                
  
(defun dtr (x)
  (* pi (/ x 180.0))
)

(princ)  ; Clear

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.