Jump to content

How can I write the code for a batch fillet plugin for images like this?


Recommended Posts

Posted

Drawing2.dwg

 

As shown in the figure below:
Select multiple graphics in batch and change the R value from 0.2 to another value?

 

ScreenShot_2026-01-30_151107_009.png.3c4f4910e2903544a5da95980a20ea86.png

Posted

Code what's that for ?

 

Join Fillet R 0.4 P pickobject enter

 

All done

  • Like 1
Posted
1 hour ago, BIGAL said:

Code what's that for ?

Join Fillet R 0.4 P pickobject enter

All done

 

Have to fillet the 3 long arcs segments before joining. But yes no lisp needed for simple task.

 

image.thumb.png.cee607824745901d591eafe6148cd61c.png

 

 

 

 

Posted (edited)

The large arc is like the base radius for all the teeth, so changing that may need a complete redraw. behind the shape must be some form of formula, or design rules.

 

Sounds like a custom gear.lsp is needed.

Edited by BIGAL
Posted

Much like Elvis, the OP seems to have left the building.

 

In case there is a dramatic return, here is a LISP that should work, though unclear what "code" they want or or if this is for an actual plug-in.

 

Solved: Fillet multiple polyline all at once by lisp - Autodesk Community

 

I didn't look at Kent Cooper's version to prompt for a radius, but used the original and added something simple to it. I am sure Kent Cooper's is better.

 

(defun C:FMP_R (/ plss n rad)
  (setq rad (getdist "\nEnter fillet radius: "))
  (if (and rad (> rad 0.0))
    (progn
      (command "_.fillet" "_radius" rad)
      (if (setq plss (ssget "_:L" '((0 . "LWPOLYLINE"))))
        (repeat (setq n (sslength plss))
          (command "_.fillet" "_polyline"
                   (ssname plss (setq n (1- n))))
        )
      )
    )
  )
  (princ)
)

 

  • Like 1
Posted (edited)

Lee Mac has a similar code.

The FMP_R and fpoly codes perform conjugations with a given radius. 
Only in these codes it is impossible to set the value radius = 0
Is there a code for interfacing with a radius of 0?

There's also the marko_ribar code, but I couldn't verify it. When loading, the message appears: Unknown command.

 

Edited by Nikon
Posted

Did you bother to check the link I posted?

 

The first one in my link from Kent Cooper will do fillet>R>0 if that is the value of  FILLETRAD.

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/m-p/6473166#M130031

 

 

The FilletMultiplePolylines will work with 0 radius.

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/m-p/10151411#M130041 

Posted
1 hour ago, SLW210 said:

Did you bother to check the link I posted?

Unfortunately, I couldn't check, the link doesn't open for me...

Posted
(defun C:FMP
(/ plss n)
(if (setq plss (ssget '((0 . "LWPOLYLINE"))))
(repeat (setq n (sslength plss))
(command "_.fillet" "_polyline" (ssname plss (setq n (1- n))))
); repeat
); if
(princ)

 

I guess this is it

  • Thanks 1
Posted (edited)
1 hour ago, GLAVCVS said:
(defun C:FMP
(/ plss n)
(if (setq plss (ssget '((0 . "LWPOLYLINE"))))
(repeat (setq n (sslength plss))
(command "_.fillet" "_polyline" (ssname plss (setq n (1- n))))
); repeat
); if
(princ)

This code should perform the pairing (without specifying the radius?). The code doesn't work: unknown command.

The parenthesis after (princ) is lost. +)

Edited by Nikon
Posted (edited)
5 hours ago, SLW210 said:

The first one in my link from Kent Cooper will do fillet>R>0 if that is the value of  FILLETRAD.

The code can connect several polylines with a radius of 0.

I understood that FILLETRAD must be set beforehand.

Or do this:

(defun C:FMP0 ; = Fillet Multiple Polylines
  (/ plss n)
(setvar "FILLETRAD" 0)
  (if (setq plss (ssget '((0 . "LWPOLYLINE"))))
    (repeat (setq n (sslength plss))
      (command "_.fillet" "_polyline" (ssname plss (setq n (1- n))))
    ); repeat
  ); if
  (princ)
); defun

 

(defun C:FMP01 (/ rad plss n)
  (setq rad (getreal "
Enter the rounding radius (you can use 0): "))
  (setvar "FILLETRAD" rad)
  (if (setq plss (ssget '((0 . "LWPOLYLINE"))))
    (repeat (setq n (sslength plss))
      (command "_.fillet" "_polyline" (ssname plss (setq n (1- n))))
    )
  )
  (princ)
)

 

Edited by Nikon

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