TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Cheezee on July 23, 2015, 08:55:44 AM

Title: Auto Fillet
Post by: Cheezee 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
Title: Re: Auto Fillet
Post by: irneb 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.
Title: Re: Auto Fillet
Post by: tedg on July 23, 2015, 11:46:53 AM
Maybe this thread will help??


http://www.theswamp.org/index.php?topic=49798.msg549690#msg549690



Title: Re: Auto Fillet
Post by: ChrisCarlson on July 23, 2015, 02:13:29 PM
Or are you talking about a fillet command which fillets the polyline as you create it?
Title: Re: Auto Fillet
Post by: Cheezee 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 "
Title: Re: Auto Fillet
Post by: tedg 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)
Title: Re: Auto Fillet
Post by: irneb 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.
Title: Re: Auto Fillet
Post by: BKT 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 (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)
)
Title: Re: Auto Fillet
Post by: Cheezee 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.....
Title: Re: Auto Fillet
Post by: Cheezee 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
Title: Re: Auto Fillet
Post by: Cheezee 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....
Title: Re: Auto Fillet
Post by: Jeff H 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
Title: Re: Auto Fillet
Post by: Cheezee 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?
Title: Re: Auto Fillet
Post by: Jeff H 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 (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)
)
Title: Re: Auto Fillet
Post by: Cheezee 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
Title: Re: Auto Fillet
Post by: BKT 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.