Strange behaviour LISP _.fillet with R=0 command (ACAD 2019 & 2022)

Strange behaviour LISP _.fillet with R=0 command (ACAD 2019 & 2022)

hreuvers
Contributor Contributor
956 Views
9 Replies
Message 1 of 10

Strange behaviour LISP _.fillet with R=0 command (ACAD 2019 & 2022)

hreuvers
Contributor
Contributor

It seems AutoCAD has different definitions of the Fillet command.

The commandline Fillet gives a different output than the LISP Fillet. See image below and DWG attached.

Does anyone know how I can use/ address the *correct* Fillet definition in LISP?

 

fillet-command-VS-lisp-fillet.png

 

You can see the difference in the command line:

Select first object or [uNdo/Polyline/Radius/Trim/mUltiple]: <= this definition gives wrong output

Select first object or [Undo/Polyline/Radius/Trim/Multiple]: <= this definition gives correct output

 

Test routine:

 

 

(defun c:f0test () 
  (setvar "cmdecho" 0)
  (setq old_radius (getvar "filletrad"))
  (setvar "filletrad" 0)
  (command "_.fillet" pause pause)
  (setvar "filletrad" old_radius)
  (setvar "cmdecho" 1)
  (princ)
)

 

 

 

0 Likes
Accepted solutions (1)
957 Views
9 Replies
Replies (9)
Message 2 of 10

pendean
Community Legend
Community Legend

Are you trying to tell us something in your DWG file that is not mentioned in the words of your post?

pendean_0-1641306401617.png

 

0 Likes
Message 3 of 10

hreuvers
Contributor
Contributor

Yes, this strange behavior only arises when you have a large area with geometry in modelspace.

Therefore I have added this.

You can also add a "regen" command in the routine to overcome the strange behavior, but this is unwanted when dealing with large DWG's.

 

0 Likes
Message 4 of 10

pendean
Community Legend
Community Legend

FILLET command, not using your lisp, seemed to work fine for me at the far end: but being very far from 0,00 is a known program limitation: if REGEN solved it then why not add that step in your automation if I may ask?

0 Likes
Message 5 of 10

ВeekeeCZ
Consultant
Consultant
Accepted solution

Add this line to force the lisp to use the current acad's version of fillet.

 

(defun c:f0test () 
  (setvar "cmdecho" 0)
  (setq old_radius (getvar "filletrad"))
  (setvar "filletrad" 0)
  (initcommandversion)
  (command "_.fillet" pause pause)
  (setvar "filletrad" old_radius)
  (setvar "cmdecho" 1)
  (princ)
)

 

0 Likes
Message 6 of 10

hreuvers
Contributor
Contributor

Hi pendian,

Thank you for your reply.

 

The example image I provided was done very close to the origin.

And yes, the commandline FILLET does the job correctly, anywhere. The LISP FILLET doesn't.

 

Currently we have included the REGEN in our routine, but it is not ideal.

The REGEN takes quite some time when dealing with large DWG files and lot's of Fillet R=0 operations.

 

We are using this routine since AutoCAD R14 without problems, I seems only last versions of AutoCAD are having this issue.

0 Likes
Message 7 of 10

hreuvers
Contributor
Contributor

Thanks Willy, lifesaver!

 

OMG: FILLET is literally used as an example in the AutoDESK Help about "initcommandversion":
https://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-6176FC98-DC5D-433E-8D76-F481BE68D46A

 

0 Likes
Message 8 of 10

ВeekeeCZ
Consultant
Consultant

You know that you can simply hold Shift while selecting a second line to do the same without a lisp, right?

0 Likes
Message 9 of 10

hreuvers
Contributor
Contributor
Well, to be honest, I was not aware of this. (emoticon shame)
I think we didn't use it because we have a lot of predefined fillet routines in which F0 is logical:
F0, F1, F2, F3, F4, F5, etc..
0 Likes
Message 10 of 10

Sea-Haven
Mentor
Mentor

Have a look at this can have any fillet rad just type F1 or F12 or any f+rad value. Also does Circles and offset.

 

 

0 Likes