Author Topic: Auto Fillet  (Read 6660 times)

0 Members and 1 Guest are viewing this topic.

Cheezee

  • Guest
Auto Fillet
« on: July 23, 2015, 08:55:44 AM »
Hi guys, hope you can help me..
Can someone make a LSP that can make an auto -  fillet after the third click point.
I mean first click will be reference point then second point is the end point of the line then the third click will be
turning point which is fillet. Before making this above action the LSP first ask for the radius of the fillet

Thank you in advance

Pls see attachment
« Last Edit: July 23, 2015, 10:53:46 PM by Cheezee »

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Auto Fillet
« Reply #1 on: July 23, 2015, 09:09:37 AM »
Could you perhaps show a picture? Perhaps the sequence of clicks and then what the result should look like. Sorry, I'm having difficulty understanding.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

tedg

  • Swamp Rat
  • Posts: 811
Re: Auto Fillet
« Reply #2 on: July 23, 2015, 11:46:53 AM »
Windows 10 Pro 64bit, AutoCAD 2023, REVIT 2023

ChrisCarlson

  • Guest
Re: Auto Fillet
« Reply #3 on: July 23, 2015, 02:13:29 PM »
Or are you talking about a fillet command which fillets the polyline as you create it?

Cheezee

  • Guest
Re: Auto Fillet
« Reply #4 on: July 23, 2015, 07:26:43 PM »
Sorry forgot to attach What I want to happened in customized Pline+fillet command
you see at attachment it is in diagonal but sometimes the third click can be vertical position

" Reason for this customized command is to minimized my space button during dwg layout "
« Last Edit: July 23, 2015, 10:54:12 PM by Cheezee »

tedg

  • Swamp Rat
  • Posts: 811
Re: Auto Fillet
« Reply #5 on: July 24, 2015, 08:48:19 AM »
Sorry forgot to attach What I want to happened in customized Pline+fillet command
you see at attachment it is in diagonal but sometimes the third click can be vertical position

" Reason for this customized command is to minimized my space button during dwg layout "
Maybe this wicked basic routine:?
(I know others (*coughLeeMac* will have a much more cleaner fancier routine to do this.. but this does what you're asking)
This prompts you for the radius....wasn't sure how you planned on handling that. re-read your first post, this asks first.
Code: [Select]

(defun c:fp (/ rad)
(setq rad (getreal "Radius?")) (terpri)
(command ".pline" pause pause pause "")
(command ".fillet" "p" "last" "r" rad "")
)
(princ)
« Last Edit: July 24, 2015, 08:51:37 AM by tedg »
Windows 10 Pro 64bit, AutoCAD 2023, REVIT 2023

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Auto Fillet
« Reply #6 on: July 24, 2015, 10:12:16 AM »
Does your polyline only contain 3 vectors with the fillet in the middle? Always? If so, something like tedg's is probably easiest.

But it also means you cannot just continue with the polyline ... it would probably be more clicks / space bars to accomplish such.

I can imagine some sort of PL option to specify a fillet on the previous vector while drawing a polyline, but that would probably need DotNet/ObjectARX to accomplish properly. With Lisp it'd be a situation of collecting the points first, and only actually drawing the PL afterwards - i.e. the preview may not look correct.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

BKT

  • Newt
  • Posts: 27
Re: Auto Fillet
« Reply #7 on: July 24, 2015, 12:08:39 PM »
If you need to use more than three points, I just tried this on BricsCAD and it works there.  Credit goes to an old post by Steve Johnson on Google groups:

https://groups.google.com/forum/#!topic/autodesk.autocad.customization/8p31AwfNeUs

Code: [Select]
(defun c:test (/ filrad rad1)

(setq filrad (getvar "filletrad"))
(setq rad1 (getreal "\n Enter Fillet Radius: "))
(setvar "filletrad" rad1)

(command "._pline")
   (while (= 1 (logand 1 (getvar "CMDACTIVE"))) (command pause))
   (command "._fillet" "_P" (entlast)
   )

(setvar "filletrad" filrad)
(princ)
)

Cheezee

  • Guest
Re: Auto Fillet
« Reply #8 on: July 24, 2015, 11:28:48 PM »
Thank you for your quick response.. what I'm trying to achieve is combination of PLine and Fillet to minimize the use of space bar..After the user input the radius it will not ask again for the radius because it will be constant throughout the command in dwg file.
The above code correct for single but in continuous it may also need space bar and input of radius

what I usually do is to make line command then space bar after drawing the above image(before) I need to fillet the corner using command F then R as show in the image(after)

Is it possible?? or should stick with PLine and Filler with more space bar.....

Cheezee

  • Guest
Re: Auto Fillet
« Reply #9 on: July 24, 2015, 11:32:32 PM »
Does your polyline only contain 3 vectors with the fillet in the middle? Always? If so, something like tedg's is probably easiest.

But it also means you cannot just continue with the polyline ... it would probably be more clicks / space bars to accomplish such.

I can imagine some sort of PL option to specify a fillet on the previous vector while drawing a polyline, but that would probably need DotNet/ObjectARX to accomplish properly. With Lisp it'd be a situation of collecting the points first, and only actually drawing the PL afterwards - i.e. the preview may not look correct.

maybe your right I want is continuous command with single input of radius


no idea about DotNet/ObjectARX  :-o

Cheezee

  • Guest
Re: Auto Fillet
« Reply #10 on: July 24, 2015, 11:39:05 PM »
Is it possible those two command in single command?
I mean you will input radius once then the rest will be just clicking no more space bar...
At middle point of every intersection/corner of pline will automatically fillet....

Jeff H

  • Needs a day job
  • Posts: 6144
Re: Auto Fillet
« Reply #11 on: July 24, 2015, 11:46:13 PM »
Is below screencast what your talking about?
This is using the current annotation scale to set radius but can be changed.

https://screencast.autodesk.com/Main/Details/0c255475-447e-466e-985e-b6b783841092

Cheezee

  • Guest
Re: Auto Fillet
« Reply #12 on: July 24, 2015, 11:55:42 PM »
Is below screencast what your talking about?
This is using the current annotation scale to set radius but can be changed.

https://screencast.autodesk.com/Main/Details/0c255475-447e-466e-985e-b6b783841092

Yes this is what I'm looking for uhhmmp how can I get the code?

Jeff H

  • Needs a day job
  • Posts: 6144
Re: Auto Fillet
« Reply #13 on: July 25, 2015, 01:24:10 AM »
It is .net and would need some stripping as it has some other functionality but if I knew lisp I probably would used something similar to below as it performs same function.

If you need to use more than three points, I just tried this on BricsCAD and it works there.  Credit goes to an old post by Steve Johnson on Google groups:

https://groups.google.com/forum/#!topic/autodesk.autocad.customization/8p31AwfNeUs

Code: [Select]
(defun c:test (/ filrad rad1)

(setq filrad (getvar "filletrad"))
(setq rad1 (getreal "\n Enter Fillet Radius: "))
(setvar "filletrad" rad1)

(command "._pline")
   (while (= 1 (logand 1 (getvar "CMDACTIVE"))) (command pause))
   (command "._fillet" "_P" (entlast)
   )

(setvar "filletrad" filrad)
(princ)
)

Cheezee

  • Guest
Re: Auto Fillet
« Reply #14 on: July 25, 2015, 02:04:21 AM »
oohh that .net hhmmpp seem to be impossible to get..
the lsp code is reguires to choice arch etc... it is not the same as autofillet in autodesk

BKT

  • Newt
  • Posts: 27
Re: Auto Fillet
« Reply #15 on: July 25, 2015, 12:01:51 PM »
Try this:

Code: [Select]
(defun c:test ()

(if (= rad1 nil)
    (progn
      (setq rad1 (getreal "\n Enter Fillet Radius: "))
      (setvar "filletrad" rad1)
    )
)

(command "._pline")
    (while (= 1 (logand 1 (getvar "CMDACTIVE"))) (command pause))
    (command "._fillet" "_P" (entlast)
    )

(princ)

)

You should only need to enter the radius once for each session.