pkenewell Posted March 8, 2021 Posted March 8, 2021 @Erhanask Here is how you make this program work like the FILLET command in the sense that it will use the last default radius until you select the keyword "Radius" or "R" to change it. Look at my comment in the code to set the initial default if you are in a new drawing. I have currently just used 0.5, but you can set it to something more appropriate for your scale. ;; original code written by Lee Mac. Altered By P. Kenewell (defun c:qarc ( / a b c r z ) (setq z (trans '(0 0 1) 1 0 t) a (angle '(0 0) (trans (getvar 'ucsxdir) 0 z t)) b (+ a 4.712388980384689) ) (if (not qarc:def)(setq qarc:def 0.5)) ;Set the default radius to your preference (setq r qarc:def) (princ (strcat "\nCurrent Radius = " (rtos r 2 3))) (initget "Radius") (while (setq c (getpoint "\nArc center [Radius]: ")) (if (= c "Radius") (if (not (setq r (getdist (strcat "\nSpecify arc radius <" (rtos qarc:def 2 3) ">: ")))) (setq r qarc:def) (setq qarc:def r) ) (entmake (list '(000 . "ARC") (cons 040 r) (cons 050 a) (cons 051 b) (cons 010 (trans c 1 z)) (cons 210 z) ) ) ) (initget "Radius") ) (princ) ) @Lee Mac may have a more efficient way to code this. 1 Quote
Erhanask Posted March 18, 2021 Posted March 18, 2021 On 3/8/2021 at 6:17 PM, pkenewell said: @Erhanask Here is how you make this program work like the FILLET command in the sense that it will use the last default radius until you select the keyword "Radius" or "R" to change it. Look at my comment in the code to set the initial default if you are in a new drawing. I have currently just used 0.5, but you can set it to something more appropriate for your scale. ;; original code written by Lee Mac. Altered By P. Kenewell (defun c:qarc ( / a b c r z ) (setq z (trans '(0 0 1) 1 0 t) a (angle '(0 0) (trans (getvar 'ucsxdir) 0 z t)) b (+ a 4.712388980384689) ) (if (not qarc:def)(setq qarc:def 0.5)) ;Set the default radius to your preference (setq r qarc:def) (princ (strcat "\nCurrent Radius = " (rtos r 2 3))) (initget "Radius") (while (setq c (getpoint "\nArc center [Radius]: ")) (if (= c "Radius") (if (not (setq r (getdist (strcat "\nSpecify arc radius <" (rtos qarc:def 2 3) ">: ")))) (setq r qarc:def) (setq qarc:def r) ) (entmake (list '(000 . "ARC") (cons 040 r) (cons 050 a) (cons 051 b) (cons 010 (trans c 1 z)) (cons 210 z) ) ) ) (initget "Radius") ) (princ) ) @Lee Mac may have a more efficient way to code this. On 3/8/2021 at 6:17 PM, pkenewell said: @Erhanask Here is how you make this program work like the FILLET command in the sense that it will use the last default radius until you select the keyword "Radius" or "R" to change it. Look at my comment in the code to set the initial default if you are in a new drawing. I have currently just used 0.5, but you can set it to something more appropriate for your scale. ;; original code written by Lee Mac. Altered By P. Kenewell (defun c:qarc ( / a b c r z ) (setq z (trans '(0 0 1) 1 0 t) a (angle '(0 0) (trans (getvar 'ucsxdir) 0 z t)) b (+ a 4.712388980384689) ) (if (not qarc:def)(setq qarc:def 0.5)) ;Set the default radius to your preference (setq r qarc:def) (princ (strcat "\nCurrent Radius = " (rtos r 2 3))) (initget "Radius") (while (setq c (getpoint "\nArc center [Radius]: ")) (if (= c "Radius") (if (not (setq r (getdist (strcat "\nSpecify arc radius <" (rtos qarc:def 2 3) ">: ")))) (setq r qarc:def) (setq qarc:def r) ) (entmake (list '(000 . "ARC") (cons 040 r) (cons 050 a) (cons 051 b) (cons 010 (trans c 1 z)) (cons 210 z) ) ) ) (initget "Radius") ) (princ) ) @Lee Mac may have a more efficient way to code this. Quote
devitg Posted April 12, 2021 Posted April 12, 2021 @ pkenewell , why not to use ? ( + a ( * pi 1.5)) Instead of (+ a 4.712388980384689) Quote
pkenewell Posted April 12, 2021 Posted April 12, 2021 30 minutes ago, devitg said: @ pkenewell , why not to use ? ( + a ( * pi 1.5)) Instead of (+ a 4.712388980384689) @devitg That would work fine. I just did not want to change Lee's code any more than necessary. Quote
pkenewell Posted April 12, 2021 Posted April 12, 2021 2 hours ago, devitg said: Ok, so I should ask Lee. Thanks @devitg I am saying that your alternate piece of code will work the same if you want to use it. 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.