Jump to content

Recommended Posts

Posted

Hello everyone
Lisp makes the pairing of two lines along a given radius.

Please help me make a choice of a frame for rounding several rods in one session. Thank you.
 

(defun c:radfit(/ l i r) ; bend radii for fittings 2d for d20 and <, - 3d for d >20;
  (setq l '((6 8 10 12 16 20 25 32 36 40) (12 16 20 24 32 40 75 96 108 120)))

  (initget 1 (apply 'strcat (mapcar ''((x) (strcat (itoa x) " ")) (car l))))
  ;(initget 1 "6 8 10 12 16 20 25 32 36 40 "); same validation

  (and 
    (setq i (getkword "\nEnter size? "))
    (setq r (cadr (assoc (atoi i) (apply 'mapcar (cons 'list l))))) ;Doug Wilson's transpose
    ;((6 12) (8 16) (10 20) (12 24) (16 32) (20 40) (25 75) (32 96) (36 108) (40 120))

    (setvar 'filletrad r)
  ) ;new fillet radius value, r
  (vl-cmdf "_FILLET" "p") ;invoke command fillet
  (princ)
)

 

Posted

My $0.05

image.png.1316e2ce2f6655fea6fddba8e3beeb67.png

(defun c:radfit(/ l) ; bend radii for fittings 2d for d20 and <, - 3d for d >20;
(if (not AH:Butts)(load "Multi Radio buttons.lsp"))
(setq l '("please choose radius " "6" "8" "10" "12" "16" "20" "25" "32" "36" "40"))
(setq ans (ah:butts 1 "V" l))
(cond
((= ans "6") (setvar 'filletrad 12))
((= ans "8") (setvar 'filletrad 16))
((= ans "10") (setvar 'filletrad 20)) 
((= ans "12") (setvar 'filletrad 24)) 
((= ans "16") (setvar 'filletrad 32 )) 
((= ans "20") (setvar 'filletrad 40 )) 
((= ans "25") (setvar 'filletrad 75 )) 
((= ans "32") (setvar 'filletrad 96 )) 
((= ans "36") (setvar 'filletrad 108 )) 
((= ans "40") (setvar 'filletrad 120))
)
(vl-cmdf "_FILLET")
  (princ)
)

Multi radio buttons.lsp

Posted

BIGAL

Thanks for the answer, but I just need to select several pairs of rods to mate with a given radius, frame, or one at a time, the choice of radius in the window is not necessary.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...