Jump to content

Recommended Posts

Posted

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

Posted

6*3=18

8*3=24

10*3=30

 

...*3=...

 

40*3=120

Posted

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..

Posted

Yes is 3*bd till dia 20 more than 20 is 4*bd

Posted
Kindly lisp is not working

 

Of course not working if you never try to write it :ouch:

 

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)
 )

Posted
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)
)

Posted

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

  • 6 years later...
Posted (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 by Nikon
Posted (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 by BIGAL

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...