Jump to content

Recommended Posts

Posted

After completing a car park project realised how many times I filleted the kerb returns which are made up of either two or 3 lines so I wrote a multi line fillet option that use a single known radius and then calculates the other line offsets to work out the parallel radius. this may exist already but may be usefull to some one.

 

Please feel to modify and post new versions here. Its pretty self explanatory pick 3 pts outside centre outside

 

;;;---------------------------------------------------------------------------
;;;
;;;   autokerb rad.LSP   Version 1.0
;;;   by Alan H
;;;   1 Aug 2011
;;;   uses fillet given inside radius for any number of lines 
;;; 
;;;---------------------------------------------------------------------------
(defun C:krad (/ CM EN EN2 NUM OLDSNAP PT1 PT2 PT3 RAD SS1 SS2 TP1 TP2 ANS NUM2 PT4 X Y)
(vl-load-com)
(setq cm (getvar "cmdecho"))
(setvar "cmdecho" 1)
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
(setq pt1 (getpoint "\nPick outside first kerb :"))
(setq pt2 (getpoint Pt1 "\nPick centre pt :"))
(setq pt3 (getpoint pt2 "\nPick outside second kerb :"))
(setq rad (getreal "\nEnter  radius  :"))
(setq ss1 (ssget "F" (list pt1 pt2)))
(setq ss2 (ssget "F" (list pt3 pt2)))
(setq num (sslength ss1))
(setq num2 (sslength ss2))
(if (/= num num2)
(progn
(princ "\nYou have unequal number of lines ")
(Setq ans (getstring "\Press any key when ready and try again")) 
(exit)
)
)
(repeat num
(setq en (ssname ss1 0))
(setq en2 (ssname ss2 0))
(setq tp1 (cons (vlax-curve-getClosestPointTo en pt2) tp1))
(setq tp2 (cons (vlax-curve-getClosestPointTo en2 pt2) tp2))
                                    
(ssdel en ss1)   ; Delete each measured entity from set  
(ssdel en2 ss2)   ; Delete each measured entity from set                
)   ; end repeat
(reverse tp2)
(setq pt1 (nth 0 tp1))
(setq pt2 (nth 0 tp2))
(setvar "filletrad" rad) 
(command "fillet" pt1 pt2)
(setq num (- num 1))
(setq x 0)
(repeat  num
(setq pt1d (nth x tp1))
(setq pt2d (nth (+ x 1) tp1))
(setq rad (+ rad (distance pt1d pt2d)))   ;  add distance between to rad
(setvar "filletrad" rad)
(setq pt1 (nth (+ x 1) tp1))
(setq pt2 (nth (+ x 1) tp2))
(command "fillet" pt1 pt2) 
(setq x (+ x 1))
)     ; end repeat 

(setvar "CMDECHO" cm)
(setvar "osmode" oldsnap)
)

(princ)

 

Maybe a full VL version ?

  • 11 years later...
Posted

Hi @BIGAL, I'm having trouble getting this to work. I'm on 2024 ACAD.

 

See GIF of what I'm doing.

 

spacer.png

Posted

I will redo the code probably look at date 2011. It should be a drag over lines then fillet say based on 1st drag line then could have a Kerb&tray blending to a barrier kerb as an extra option.

 

image.png.378abc2637e1f6cb6e3906e46cf77da2.png

Possibly later today.

 

  • Like 1
Posted (edited)

Is that a variation where all the fillets are the same? Still looks cool. Edit: Think I have this and forgot about it. 

Edited by 3dwannab
Posted

Is the rad.lsp not different? That's the one I was having issues with.

Posted

I don't use other's codes and I just write mine from A to Z, so my program would fillet connected line object types with fixed radii entered by a user.

Posted (edited)

My bad. @BIGAL is the author.

 

EDIT: Is the program released publicly?

Edited by 3dwannab
Posted
On 6/8/2023 at 8:32 PM, Tharwat said:

Yes, all fillets are with the same radius.

 

However in this case the radii should change to match real world kerb designs I think.

Posted

2  versions required, Tharwat fixed radius version and a changing radius based on line spacing changing radius as going outwards or inwards.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...