Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to code Defun for Fillet / Radius

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Anonymous
1029 Views, 7 Replies

How to code Defun for Fillet / Radius

I'm trying to write a simple Defun code that will start the fillet command and select the Radius option - then go from there.

 

This is what I have, but it will not work, what am I doing wrong???

(DEFUN C:FR()  (COMMAND "FILLET" "RADIUS"))

7 REPLIES 7
Message 2 of 8
p_mcknight
in reply to: Anonymous

Try this:

(DEFUN C:TEST39 ( ) (COMMAND ".FILLET" "RADIUS" PAUSE ".FILLET"))

Message 3 of 8
Kent1Cooper
in reply to: Anonymous

Depending on what about it doesn't work, it could be that you have an undefined/redefined Fillet command [Architectural Desktop does that], in which case (command "fillet" ...) will say it doesn't know that command name.  If that's the issue, force it to use the native AutoCAD command, with the decimal/period prefix to the command name:

 

(DEFUN C:FR () (COMMAND ".FILLET" "RADIUS"))

 

And if you want people with all different language versions of AutoCAD to be able to use it, add the underscore prefix to the command name and the option word:

 

(defun C:FR () (command "_.fillet" "_radius"))

Kent Cooper, AIA
Message 4 of 8
Anonymous
in reply to: Kent1Cooper

Thanks Keith,
But that does not work for me either, I get "Unknown Command "FR"

When I type FR with your code.
Message 5 of 8
p_mcknight
in reply to: Anonymous

What are the exact issues with your original code? When I tried it on my machine it exited the fillet after accepting the radius which is why I suggested simply recalling the fillet after you give it the radius.  It seemed to work on my machine.

Message 6 of 8
stevor
in reply to: Anonymous

Zoot, it works on my old autocad, just as he stated.

You may not be loading it properly.

The following string, with no spaces after the last parens, )),

can be copied and pasted into the command line.

 

(DEFUN C:FR () (COMMAND ".FILLET" "RADIUS"))

 

A common addition is provide a default value for the radius.

 

 

 

 

S
Message 7 of 8
dgorsman
in reply to: Anonymous

A comment on command naming: use a full command name (e.g. FILLETRAD rather than an abbreviated one (FR).  If you decide to use FR for something else later on you need to go through the PGP, LISP files, and so on to find it.  Given the limited number of two letter combinations its possible to run into naming conflicts as well, where another C:FR defun will replace this one.  Use the PGP the same as you would with any other built-in command to associate FR with the full command name.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 8 of 8
Kent1Cooper
in reply to: dgorsman


@dgorsman wrote:

... use a full command name (e.g. FILLETRAD rather than an abbreviated one (FR). ....


[But in this case, don't use FILLETRAD specifically -- that's a System Variable name, and therefore also already a "command" name, since System Variable names can be used like commands, to set their values.  Use FILRAD, or FILLETR, or (for quicker left-hand-only typing) FRAD, or FFR, or something.]

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost