Message 1 of 23
CommaCommand to draw a tapped hole, top and side and add dimension

Not applicable
08-13-2020
10:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
;;Command to draw a tapped hole, top and side and add dimension.
;;
;;1) need help, how can we make "dimpost" a variable that fills in the dim dia?
;;2) want to make the pattern below work with a several different hole sizes
;;thanks for any help, Steve
;;
;;1) need help, how can we make "dimpost" a variable that fills in the dim dia?
;;2) want to make the pattern below work with a several different hole sizes
;;thanks for any help, Steve
(defun c:th3 ()
;;;(SETQ a (/(getreal "\nEnter Tap Dia :")2))
;;;(SETQ b (/(getreal "\nEnter Drill Size :")2))
(SETQ a 0.125) ;radius of .250 dia threads
(SETQ b 0.1005) ;radius of .201 dia thru hole
(SETVAR "DIMPOST" "\\P\ <>-20 TAP \\P\.201 DRILL")
(SETQ P (GETPOINT "\SELECT center point"))
(setq c1 (car P));x
(setq c2 (cadr P));Y
(setq xl (- c1 a))
(setq xr (+ c1 a))
(setq cpd (-(- c2 a)a))
(setq xdl (- c1 b))
(setq xdr (+ c1 b))
(setq sc (* 0.707106781 a)) ;trig for sin and csin
(setq lx (- c1 sc))
(setq ly (- c2 sc))
(SETQ SC1 (+(* 1.4 a)C1)) ;POINT X 90° OF P
(setq dir1 (polar p -100 (+ a 1.0)));
(setq dir2 (polar p 0 a))
(setq p1 (list xl cpd));xy left tap
(setq p2 (list xr cpd));xy right tap
(setq p3 (list c1 cpd));xy center
(setq p4 (list xdl cpd));xy left drill
(setq p5 (list xdr cpd));xy right drill
(setq p6 (list lx ly));POINT 45° AT A RAD
(setq p7 (list SC1 C2));POINT 90° OF P XY
(command "_circle" P b "")
(command "_line" p1 "@0.0, -2.0" "")
(command "_change" "last" "" "p" "lt" "HIDDEN2" "")
(command "_line" p2 "@0.0, -2.0" "")
(command "_change" "last" "" "p" "lt" "HIDDEN2" "")
(command "_line" p3 "@0.0, -2.0" "")
(command "_change" "last" "" "p" "lt" "CENTER2" "")
(command "_line" p4 "@0.0, -2.0" "")
(command "_line" p5 "@0.0, -2.0" "")
(command "_.ARC" "C" "_non" p "_non" (polar p (angtof "22.5") A) "_non" (polar p (angtof "67.5") A))
(command "_array" "LAST" "" "polar" p "4" "360" "y")
(command "_line" p P7 ""); drawl line for cross hairs
(command "_array" "LAST" "" "polar" p "4" "360" "y"); cross hairs
(command "_DIMDEC" 3)
(command "circle" p a "") ;draw circle
(setq h (entlast));get last ent
(command "dimdiameter" dir2 dir1) ;dim circle
(command "erase" h "") ;erase circle
(command "_line" p P7 "")
(command "_arraypolar" "LAST" "" p "A" "90" "I" "4" "")
(SETVAR "DIMPOST" "<>")
)