TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started 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
-
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.
-
Maybe this thread will help??
http://www.theswamp.org/index.php?topic=49798.msg549690#msg549690
-
Or are you talking about a fillet command which fillets the polyline as you create it?
-
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 "
-
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.
(defun c:fp (/ rad)
(setq rad (getreal "Radius?")) (terpri)
(command ".pline" pause pause pause "")
(command ".fillet" "p" "last" "r" rad "")
)
(princ)
-
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.
-
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)
(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)
)
-
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.....
-
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
-
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....
-
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
-
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?
-
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)
(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)
)
-
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
-
Try this:
(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.