Nikon Posted June 15, 2023 Posted June 15, 2023 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) ) Quote
BIGAL Posted June 15, 2023 Posted June 15, 2023 My $0.05 (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 Quote
Nikon Posted June 16, 2023 Author Posted June 16, 2023 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. Quote
Recommended Posts
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.