Jump to content

Recommended Posts

Posted

I am looking for a lisp routine to fillet all intersecting lines on a particular layer. Basically I have a circuit drawn and want to show rounded corners at all angles. Does anyone have something like this?

 

Thanks!

Posted

If you would post a DWG of lines. One group before the fillet and one group showing the result of the fillet.

What if the lines overlap and do not meet end to end?

Posted

Thanks for the replies. I see that I probably didn't state the problem clear enough. Actually I would just fillet lines which touch end to end. Lines which crossed other lines (i.e. intersected) would not be filleted (if that is a word). I have started cobbling some lisp together; however, I thought someone may have already done this or could shed some light on an easy approach. I'll try to post a drawing showing before and after later today.

 

Thanks!

Posted

If the lines are joining end to end, then you could create a polyline, which only joins those lines which are touching. Then fillet the polyline, and all corners are curved.

 

Perhaps no need for lisp :shock:

Posted

Pseudo Code

User selects an object to determine layer to use

ssget all lines on that layer in that space

loop through selection set & get any matching end points & there owners

Loop through the end-point match list & fillet with error trap.

If there is more than one endpoint match, not sure but ignore at this time.

 

Use the fillet command like this:

(defun c:test(/ ent1 ent2 StartPt1 StartPt2 EndPt1 EndPt2 FilletPt1 FilletPt2)
 ;;  returns '(<ename> point)
 (defun GetFilletPoint (ent from / fuzz len)
   (setq len (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent)))
   (list ent
     (if (= from "start")
       (vlax-curve-getpointatdist ent (/ len 4.0))
       (vlax-curve-getpointatdist ent (* len 0.75)) ; from "end"
     )
   )
 )
 
 (setq fuzz 0.0001)
 (setq ent1 (car (entsel "\nSelect entity One.")))
 (setq ent2 (car (entsel "\nSelect entity two.")))
 (setq StartPt1 (vlax-curve-getstartpoint ent1))
 (setq EndPt1 (vlax-curve-getendpoint ent1))
 (setq StartPt2 (vlax-curve-getstartpoint ent2))
 (setq EndPt2 (vlax-curve-getendpoint ent2))
 (cond
   ((< (distance StartPt1 StartPt2) fuzz)
    (setq FilletPt1 (GetFilletPoint ent1 "start")
          FilletPt2 (GetFilletPoint ent2 "start")
    )
   )
   ((< (distance StartPt1 EndPt2) fuzz)
    (setq FilletPt1 (GetFilletPoint ent1 "start")
          FilletPt2 (GetFilletPoint ent2 "end")
    )
   )
   ((< (distance EndPt1 StartPt2) fuzz)
    (setq FilletPt1 (GetFilletPoint ent1 "end")
          FilletPt2 (GetFilletPoint ent2 "start")
    )
   )
   ((< (distance EndPt1 EndPt2) fuzz)
    (setq FilletPt1 (GetFilletPoint ent1 "end")
          FilletPt2 (GetFilletPoint ent2 "end")
    )
   )
 )
 (if (and FilletPt1 FilletPt2)
   (setq err (vl-catch-all-apply 
              '(lambda () 
                 (command "_.fillet" FilletPt1 FilletPt2) 
               )
             )
   )
   (princ "\nCon not fillet these objects.")
 )
 (if (vl-catch-all-error-p err) ; yes, error
  (alert (vl-catch-all-error-message err))
 )
 
 (princ)
)

Posted

Awesome. Thanks for your help. I am going to pull this in and work with it. I'll let you know how it goes.

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...