wrha Posted October 22, 2017 Posted October 22, 2017 kindly i need help to make lisp help to do fillet as per bars diameter as below example . when i type 6 fillet radius to be 20 when 8 fillet radius 24 when 10 fillet radius 32 when 12 fillet radius 36 when 16 fillet radius 48 when 20fillet radius 60 when 25 fillet radius 75 when 32 fillet radius 96 when 36 fillet radius 108 when 40 fillet radius 120 Quote
marko_ribar Posted October 22, 2017 Posted October 22, 2017 6*3=18 8*3=24 10*3=30 ...*3=... 40*3=120 Quote
hanhphuc Posted October 23, 2017 Posted October 23, 2017 perhaps [color="blue"]initget getkword[/color][color="green"] ;for validation[/color] (setq r (cadr(assoc i LST)))[color="green"] ; (setq LST '((6 20)(8 24)(10 32)....(36 108)(40 120)))[/color] (setvar 'filletrad r) @OP just try it.. Quote
halam Posted October 23, 2017 Posted October 23, 2017 Here is one. For bigger radius it 2.5 d, smaller ones 3.0 https://www.civilinfrabnl.nl/index.php/forum/9-algemene-vragen/2581-fillet-line-and-or-pline Quote
BIGAL Posted October 23, 2017 Posted October 23, 2017 Need to check bar bending standards also is 3*Bd correct ? Quote
wrha Posted October 23, 2017 Author Posted October 23, 2017 Yes is 3*bd till dia 20 more than 20 is 4*bd Quote
hanhphuc Posted October 23, 2017 Posted October 23, 2017 Kindly lisp is not working Of course not working if you never try to write it here's example (defun c:test ( / l i r ) (setq l '((6 8 10 12 16 20 25 32 36 40) (20 24 32 36 48 60 75 96 108 120))) ([color="blue"]initget[/color] 1 (apply 'strcat (mapcar ''((x)(strcat(itoa x) " "))(car l)))) [color="green"];(initget 1 "6 8 10 12 16 20 25 32 36 40 "); same validation [/color] (and (setq i ([color="blue"]getkword[/color] "\nEnter size? ")) (setq r (cadr ([color="blue"]assoc[/color] (atoi i) (apply 'mapcar (cons 'list l))))) [color="green"];Doug Wilson's transpose[/color] [color="green"];((6 20) (8 24) (10 32) (12 36) (16 48) (20 60) (25 75) (32 96) (36 108) (40 120)) [/color] (setvar 'filletrad r)) [color="green"];new fillet radius value, r [/color] (vl-cmdf "_FILLET" "p") [color="green"];invoke command fillet[/color] (princ) ) Quote
Grrr Posted October 23, 2017 Posted October 23, 2017 Yes is 3*bd till dia 20 more than 20 is 4*bd (defun C:test ( / input ) (if (setq input (getreal "\nEnter a number: ")) (alert (rtos (if (< input 20) (* 3 input) (* 4 input) ) 2 2 ) ) ) (princ) ) But this means that for input of 10 the value would be 30 and for 36 the value would be 144. kindly i need help to make lisp help to do fillet as per bars diameter as below example . when i type 6 fillet radius to be 20 when 8 fillet radius 24 when 10 fillet radius 32 when 12 fillet radius 36 when 16 fillet radius 48 when 20fillet radius 60 when 25 fillet radius 75 when 32 fillet radius 96 when 36 fillet radius 108 when 40 fillet radius 120 Perhaps something between the two: (defun C:test ( / n v ) (if (setq n (getreal "\nEnter a number: ")) (alert (rtos (if (setq v (cadr (assoc n '((6 20) (8 24) (10 32) (12 36) (16 48) (20 60) (25 75) (32 96) (36 108) (40 120))))) v (if (< n 20) (* 3 n) (* 4 n) ) ) 2 2 ) ) ) (princ) ) Quote
wrha Posted October 24, 2017 Author Posted October 24, 2017 The lisp shows the bending factor of the diameter i wish the fillet can happen when I entered the bar diameter in between tow lines Quote
Nikon Posted December 16, 2023 Posted December 16, 2023 (edited) Hi guys, After reading this topic «New Forum Code Tags» https://www.cadtutor.net/forum/topic/64197-lisp-for-bars-bending-factors/ ;; hanhphuc Posted October 23, 2017 (defun c:test ( / l i r ) (setq l '((6 8 10 12 16 20 25 32 36 40) (20 24 32 36 48 60 75 96 108 120))) ([color="blue"]initget[/color] 1 (apply 'strcat (mapcar ''((x)(strcat(itoa x) " "))(car l)))) [color="green"];(initget 1 "6 8 10 12 16 20 25 32 36 40 "); same validation [/color] (and (setq i ([color="blue"]getkword[/color] "\nEnter size? ")) (setq r (cadr ([color="blue"]assoc[/color] (atoi i) (apply 'mapcar (cons 'list l))))) [color="green"];Doug Wilson's transpose[/color] [color="green"];((6 20) (8 24) (10 32) (12 36) (16 48) (20 60) (25 75) (32 96) (36 108) (40 120)) [/color] (setvar 'filletrad r)) [color="green"];new fillet radius value, r [/color] (vl-cmdf "_FILLET" "p") [color="green"];invoke command fillet[/color] (princ) ) After application program ForumCodeTags.exe the contents in square brackets have been removed [color="blue"]… After BB codes removed which contents within the brackets "[" "]". (defun c:test_col_ex ( / l i r ) (setq l '((6 8 10 12 16 20 25 32 36 40) (20 24 32 36 48 60 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 20) (8 24) (10 32) (12 36) (16 48) (20 60) (25 75) (32 96) (36 108) (40 120)) (setvar 'filletrad r)) ;new fillet radius value, r (vl-cmdf "_FILLET" "p") ;invoke command fillet (princ) ) LISP is verified, it works! Edited December 16, 2023 by Nikon Quote
BIGAL Posted December 16, 2023 Posted December 16, 2023 (edited) Nikon this is an old post and it is well known that the color codes appear, there will be 100's of these here and I don't think Admin want you converting all of them. Admin know about this problem it occurred when the forum was updated, many prior submissions have been updated when found to be a problem. There was a message from Admin about this problem Edited December 16, 2023 by BIGAL 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.