PDA

View Full Version : Macro to Fillet all the top edges of a box...



Eilerman
2006-02-10, 07:30 PM
Hi I am trying to make a simple button to minimize the keystrokes to fillet all the top edges of a box or whateever.....: fillet - radius - .005 - select - chain -pick edges then enter.

I tried the following (^C^C_f;r;.005;/;chain;) and a few variations, but can't seam to get it working?

Does anyone have any suggestions?
Tahnks,
Matt

Wanderer
2006-02-10, 09:34 PM
Hi I am trying to make a simple button to minimize the keystrokes to fillet all the top edges of a box or whateever.....: fillet - radius - .005 - select - chain -pick edges then enter.

I tried the following (^C^C_f;r;.005;/;chain;) and a few variations, but can't seam to get it working?

Does anyone have any suggestions?
Tahnks,
MattMatt, I'm going to move this from the LUG forum, as I believe it will be better served here, thanks!

Mike.Perry
2006-02-11, 01:57 AM
Hi I am trying to make a simple button to minimize the keystrokes to fillet all the top edges of a box or whateever.....: fillet - radius - .005 - select - chain -pick edges then enter.

I tried the following (^C^C_f;r;.005;/;chain;) and a few variations, but can't seam to get it working?Hi

Have you tried something like...


^C^C_.Fillet;_R;0.005;/;chain;Can you please explain what "chain" does.

Note, I have also removed parentheses.

Parentheses are used in LISP. Do you want to do this in LISP ?

If yes, you could use something like the following very simple LISP routine...


(defun c:FilletR ( / Save_FilletRad Save_TrimMode)
(setq Save_FilletRad (getvar "FILLETRAD"))
(setq Save_TrimMode (getvar "TRIMMODE"))
(setvar "FILLETRAD" 0.005)
(setvar "TRIMMODE" 1)
(setvar "CMDECHO" 1)
(command "._FILLET")
(while (> (getvar "CMDACTIVE") 0)
(command pause)
)
(setvar "FILLETRAD" Save_FilletRad)
(setvar "TRIMMODE" Save_TrimMode)
(princ)
)Have a good one, Mike

Eilerman
2006-02-11, 11:23 AM
Hi Mike,
The Lisp way seams like lots of typing...I was just going to make a button and add it to one of my tool bars. The "chain" links all the top edges as one fillet. So if you have some enclosed freeform poly line/arc, extrude it, you chafer all the top edges at once. There is another easy way to do the same thing...but I forgot how I use to do it? I'll try your sugestion and see how it goes.
Thanks
Matte

kennet.sjoberg
2006-02-11, 01:32 PM
. . . The Lisp way seams like lots of typing...
The lisp way is not bad if you know what to do,
behind every command like fillet there is a program.
You can make your own command with lisp ( like Mikes, but that is the program code ).
The command name is to the right of the c: in the beginning of Mikes code, the "FilletR".

You can try Mikes code as a command, do like this :
mark the code in the forum from (defun . . .to the very last parenthesis )
right click the mouse button and select copy
switch to AutoCAD and place the mouse cursor and click on the very last line in the command window Command: |
right click the mouse button and select paste then press Enter
Now you have Mikes code pasted and loaded, and the command (function) activated C:FILLETR
Next, type on the command line
Command: filletr
...and try Mikes new created command

better is to save Mikes code in a file like FilletR.lsp
and load that file automatically in your startup suit, then the filletr command is always there.

If your "box or whatever" is a polyline You have to try mikes code with this line (command "._fillet" "p" ) instead in the code. It will then trim all vertex in a open or closed polyline.

Do you like to make your own command ? Welcome to the Lisp forum.


: ) Happy Computing !

kennet

Mike.Perry
2006-02-12, 12:42 AM
The "chain" links all the top edges as one fillet. So if you have some enclosed freeform poly line/arc, extrude it, you chafer all the top edges at once.Hi

Ok! let me phrase...

Chain is not a standard AutoCAD command ( as far as I know ).

Therefore is Chain a Third Party function / utility, you or someone else wrote ?

Have a good one, Mike

Mike.Perry
2006-02-12, 12:50 AM
<SNIP>

If your "box or whatever" is a polyline You have to try mikes code with this line (command "._fillet" "p" ) instead in the code. It will then trim all vertex in a open or closed polyline.Hi Kennet

Very nice explanation :)

With the routine I posted above, the "Polyline" option from the Fillet command can still be used if required ie There is no need to make the change you have suggested above.

Example...

Command: FilletR
._FILLET
Current settings: Mode = TRIM, Radius = 0.005
Select first object or [Polyline/Radius/Trim/mUltiple]: _P
Select 2D polyline:
4 lines were filleted:beer: Mike

jaberwok
2006-02-12, 08:47 AM
"Chain" is an option of the Fillet command but only when the selected object is a solid.
That is, the command prompts are different for a solid compared to anything else.

HTH

Mike.Perry
2006-02-12, 09:55 AM
"Chain" is an option of the Fillet command but only when the selected object is a solid.
That is, the command prompts are different for a solid compared to anything else.Hi John

Good catch :)

Note - with the routine I posted above, the "Chain" option from the Fillet command can still be used if required ( if a 3D Solid is selected ).

Example...


Command: FilletR
._FILLET
Current settings: Mode = TRIM, Radius = 0.005
Select first object or [Polyline/Radius/Trim/mUltiple]:
Enter fillet radius <0.005>:

Select an edge or [Chain/Radius]: _C

Select an edge chain or [Edge/Radius]:
Select an edge chain or [Edge/Radius]:
Select an edge chain or [Edge/Radius]:
Select an edge chain or [Edge/Radius]:

4 edge(s) selected for fillet.:beer: Mike

jaberwok
2006-02-12, 01:26 PM
Hi Mike. No worries.

It's just a pity that, in this case of an essentially rectangular solid, it is necessary to pick all four edges - the initial pick pick then "chain" then the other three. In a less ordered shape, it is only necessary to make the initial pick then "chain" then one adjacent edge (end to end with the first) and acad will trace along the rest of the chain by itself.