Scoutr4 Posted May 6, 2022 Posted May 6, 2022 (edited) Hi everyone, I'm trying to write a fillet lisp. (defun C:denx () (setq p1 (ssget)) (setq p2 (ssget)) (setq p3 (ssget)) (command "_.fillet" p1 p2 "_.fillet" p1 p3) (princ) ) - make a list of the two lines I chose that I'm trying to do - I dont know how doing list. Can anyone help this? (defun C:denx () (setq p1 (ssget)) (setq p2 (ssget)); list of lines (command "_.fillet" p1 p2) (princ) ) Edited May 6, 2022 by Scoutr4 Quote
BIGAL Posted May 7, 2022 Posted May 7, 2022 (edited) Try this, ok expects main line as a single "LINE" Pick 90 line well away from fillet size. Does what you want limited testing. ; do 2 fillets to a tee line intersection ; By Alanh May 2022 (defun c:2fil ( ) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setvar 'filletrad (getreal "\nEnter radius")) (setq ent1 (entsel "\npick square off line away from intersection ")) (setq pt1 (cadr ent1)) (setq ent2 (entsel "\npick main line")) (setq obj1 (vlax-ename->vla-object (car ent1))) (setq obj2 (vlax-ename->vla-object (car ent2))) (setq pt2 (vlax-invoke obj1 'intersectwith obj2 acExtendBoth)) (setq start (vlax-get Obj2 'StartPoint)) (setq end (vlax-get Obj2 'EndPoint)) (setq pt3 (polar pt2 (angle start end) 0.05)) (setq pt4 (polar pt2 (- (angle start end) pi) 0.05)) (command "break" pt3 pt2) (setq ent3 (entlast)) (command "fillet" pt1 ent2) (command "fillet" pt1 ent3) (setvar 'osmode oldsnap) ) (c:2fil) Edited May 7, 2022 by BIGAL 1 Quote
Scoutr4 Posted May 7, 2022 Author Posted May 7, 2022 (edited) 11 hours ago, BIGAL said: Try this, ok expects main line as a single "LINE" Pick 90 line well away from fillet size. Does what you want limited testing. ; do 2 fillets to a tee line intersection ; By Alanh May 2022 (defun c:2fil ( ) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setvar 'filletrad (getreal "\nEnter radius")) (setq ent1 (entsel "\npick square off line away from intersection ")) (setq pt1 (cadr ent1)) (setq ent2 (entsel "\npick main line")) (setq obj1 (vlax-ename->vla-object (car ent1))) (setq obj2 (vlax-ename->vla-object (car ent2))) (setq pt2 (vlax-invoke obj1 'intersectwith obj2 acExtendBoth)) (setq start (vlax-get Obj2 'StartPoint)) (setq end (vlax-get Obj2 'EndPoint)) (setq pt3 (polar pt2 (angle start end) 0.05)) (setq pt4 (polar pt2 (- (angle start end) pi) 0.05)) (command "break" pt3 pt2) (setq ent3 (entlast)) (command "fillet" pt1 ent2) (command "fillet" pt1 ent3) (setvar 'osmode oldsnap) ) (c:2fil) Thank you so much but i found a problem. This autocad's normal starting.(1st photo) After clicking on the option to load the lisp file continuously from the Appload menu, I closed the Autocad program and reopened it. It is waiting in the "startup-load" menu when opening Autocad. When I press ESC, autocad completes the opening process. (2nd and 3rd photos) Edited May 7, 2022 by Scoutr4 Quote
BIGAL Posted May 8, 2022 Posted May 8, 2022 Why repeat load just appload once, to do again type 2fil. Thats what the C:2fil means its a command now just run on 1st load. 1 Quote
Scoutr4 Posted May 8, 2022 Author Posted May 8, 2022 Okay. I draw electrical installation projects. I'm currently using over 15 lisp files. I open at least 30 or 40 dwg files every day. If I upload all the files once, I always have to do this again when I open the dwg. As soon as it was installed from the Appload menu, the command was working and was asking for the radius even though I didn't enter the command. so it probably loads the command when autocad starts and asks me to enter the radius during "startup load" and autocad program fails to start. I deleted the last row and this problem solved. Thank you again. Quote
BIGAL Posted May 9, 2022 Posted May 9, 2022 (edited) Glad you realised remove last line (c:2fil) if your autoloading. I set up most of my lisps as menu or toolbar load. Ok you should look at AUTOLOAD in your start up it will load the lisp file when you type the command so you don't have 30-40 lisps already loaded. For me lisps are in search path so name only of lisp. eg PLACESDXF.lsp (autoload "TEXT2LINE" '("TEXT2LINE")) (autoload "EXLMARK" '("EXLMARK")) (autoload "MoveRotateText" '("MOVEROTATETEXT")) (autoload "PLACESDXF" '("PLACESDXF")) (autoload "PLANVIEW" '("PLANVIEW")) (autoload "p2p" '("p2p")) (autoload "p2pp" '("p2pp")) (autoload "sqp" '("sqp")) (autoload "sqlinetoend" '("sql")) (autoload "REV" '("REV")) Edited May 9, 2022 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.