Dan Kitchens Posted December 6, 2011 Share Posted December 6, 2011 Does anyone know of a lisp to fillet all the edges of all 3D solids on a selected layer, or something similar? The solids are all rectangular extrusions, and the fillet size is the same for all edges and solids. I've looked all over the net, but there doesn't seem to be much on this, just lots on polylines and lines, which I'm not after. I gather this is not an easy thing for AutoCAD to do! Dan Quote Link to comment Share on other sites More sharing options...
GP_ Posted December 6, 2011 Share Posted December 6, 2011 Try and pray (defun C:Test (/ SOLID EL vte os RAD n List_p s1 edge p1 p2 pm) ;*** GP_ 06 dec. 2011 *** (if (not (member "geomcal.arx" (arx))) (arxload "geomcal")) (setq EL (entlast)) (setq vte (getvar "vtenable")) (setq os (getvar "osmode")) (setq cmd (getvar "cmdecho")) (setvar "vtenable" 0) (setvar "cmdecho" 0) (prompt "\nSelect 3DSOLID ") (if (and (setq SOLID (ssget '((0 . "3DSOLID")))) (setq RAD (getreal "\nFillet radius ")) ) (progn (if (tblsearch "VIEW" "#") (command "_-VIEW" "_D" "#")) (command "_-VIEW" "_S" "#" ) (command "_VPOINT" "1,-1.3,1") (setvar "osmode" 0) (repeat (setq n (sslength SOLID)) (setq List_p nil) (setq s1 (ssname SOLID (setq n (1- n)))) (if (> (distof (substr (getvar "acadver") 1 4)) 18.1) (command "isolateobjects" s1 "") ) (command "_ZOOM" "_OBJ" s1 "") (command "_XEDGES" s1 "") (while (setq edge (entnext EL)) (setq p1 (cdr (assoc 10 (entget edge)))) (setq p2 (cdr (assoc 11 (entget edge)))) (entdel edge) (setq List_p (cons (cal "pm=plt(p1,p2,0.5)") List_p)) ) (repeat (setq i (length List_p)) (command "_FILLET" (nth (setq i (1- i)) List_p) RAD "") ) (if (> (distof (substr (getvar "acadver") 1 4)) 18.1) (command "unisolateobjects" "") ) ) (command "_-VIEW" "_R" "#") (command "_-VIEW" "_D" "#") (setvar "vtenable" vte) (setvar "cmdecho" cmd) (setvar "osmode" os) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Dan Kitchens Posted December 6, 2011 Author Share Posted December 6, 2011 Try and pray (defun C:Test (/ SOLID EL vte os RAD n List_p s1 edge p1 p2 pm) ;*** GP_ 06 dec. 2011 *** (if (not (member "geomcal.arx" (arx))) (arxload "geomcal")) (setq EL (entlast)) (setq vte (getvar "vtenable")) (setq os (getvar "osmode")) (setvar "vtenable" 0) (prompt "\nSelect 3DSOLID ") (if (and (setq SOLID (ssget '((0 . "3DSOLID")))) (setq RAD (getreal "\nFillet radius ")) ) (progn (if (tblsearch "VIEW" "#") (command "_-VIEW" "_D" "#")) (command "_-VIEW" "_S" "#" ) (command "_VPOINT" "1,-1.3,1") (setvar "osmode" 0) (repeat (setq n (sslength SOLID)) (setq List_p nil) (setq s1 (ssname SOLID (setq n (1- n)))) (if (> (distof (substr (getvar "acadver") 1 4)) 18.1) (command "isolateobjects" s1 "") ) (command "_ZOOM" "_OBJ" s1 "") (command "_XEDGES" s1 "") (while (setq edge (entnext EL)) (setq p1 (cdr (assoc 10 (entget edge)))) (setq p2 (cdr (assoc 11 (entget edge)))) (entdel edge) (setq List_p (cons (cal "pm=plt(p1,p2,0.5)") List_p)) ) (repeat (setq i (length List_p)) (command "_FILLET" (nth (setq i (1- i)) List_p) RAD "") ) ) (if (> (distof (substr (getvar "acadver") 1 4)) 18.1) (command "unisolateobjects" "") ) (command "_-VIEW" "_R" "#") (command "_-VIEW" "_D" "#") (setvar "vtenable" vte) (setvar "osmode" os) ) ) (princ) ) I think I will Pray, and then try. Let you know how it goes. Appreciate the help. Quote Link to comment Share on other sites More sharing options...
Dan Kitchens Posted December 6, 2011 Author Share Posted December 6, 2011 Hi GP_ I ran the code on a cube (3d solid) and got the following command line response:- Command: test Select 3DSOLID Select objects: 1 found Select objects: Fillet radius 1 ***I entered 1*** No matching view names found.Unknown command "FILLET". Press F1 for help. 1.000000 Unfortunately, I know nothing about LISP writing so I'm unable to modify to correct it. If your willing to correct it, I'd be ever so happy, if not, I thank you for trying! Quote Link to comment Share on other sites More sharing options...
GP_ Posted December 6, 2011 Share Posted December 6, 2011 I slightly modified the code. Enter a radius appropriate. Quote Link to comment Share on other sites More sharing options...
Dan Kitchens Posted December 6, 2011 Author Share Posted December 6, 2011 I couldn't find the modified code. Did you upload it? Quote Link to comment Share on other sites More sharing options...
GP_ Posted December 7, 2011 Share Posted December 7, 2011 I edited my first post. Try a cube 1x1x1 and radius 0.2 Unfortunately not always work Quote Link to comment Share on other sites More sharing options...
Dan Kitchens Posted December 7, 2011 Author Share Posted December 7, 2011 Still getting the same error on it Quote Link to comment Share on other sites More sharing options...
GP_ Posted December 7, 2011 Share Posted December 7, 2011 Zoom on the cube, there is a fillet? Quote Link to comment Share on other sites More sharing options...
Dan Kitchens Posted December 7, 2011 Author Share Posted December 7, 2011 No fillets on the cube. Just the same error as before. I think I will leave it at that. Thanks for your help anyway... Dan Quote Link to comment Share on other sites More sharing options...
GP_ Posted December 7, 2011 Share Posted December 7, 2011 Set vscurrent=Wireframe2d before launching the lisp. No one has tried? Quote Link to comment Share on other sites More sharing options...
Dan Kitchens Posted December 7, 2011 Author Share Posted December 7, 2011 Hi again GP_ My vscurrent is already set to wireframe2d, but I re-tried the code anyway. Didn't work Quote Link to comment Share on other sites More sharing options...
SLW210 Posted December 7, 2011 Share Posted December 7, 2011 Works fine for me. Command: TEST Select 3DSOLID Select objects: 1 found Select objects: Specify opposite corner: 1 found (1 duplicate), 1 total Select objects: Fillet radius .25 No matching view names found. No matching view names found. [ATTACH=CONFIG]31578[/ATTACH] Quote Link to comment Share on other sites More sharing options...
Dan Kitchens Posted December 7, 2011 Author Share Posted December 7, 2011 Must be my computer then. Looks like I will need to find another way. Quote Link to comment Share on other sites More sharing options...
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.