Jump to content

Dan Kitchens

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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