Jump to content

Recommended Posts

Posted

Hello. does anyone have a LISP that will run a continuous Fillet. I want to fillet a bunch of lines that cross without having to do the command over and over. It sould just clip the previous line selected with the next one (like a schematic profile for a stair, for instance). If it could automatically convert to a Pline also, that would be cool but not nec.

Thanks

Aaron

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    8

  • buildwitharch

    8

  • hkncdrc

    4

  • marko_ribar

    3

Posted

Not a lisp but try changing your menu button to read-

 

*^C^C_fillet

 

The '*' tells it to repeat the command so once you have clicked it, and given a radius if you want, you just have to keep picking the lines you want to fillet.

Press Esc to stop the repetition.

Posted

Walking out the door, so I can't finish, but it's basically there...

 

(defun c:CF (/ e1 e2)
 (while (and (setq e1 (entsel "\nSelect curve: "))
             (or (vl-position (cdr (assoc 0 (entget e1))) '("ARC" "LINE" "LWPOLYLINE"))
                 (alert "Invalid object!"))
             (setq e2 (entsel "\nSelect other curve: "))
             (or (vl-position (cdr (assoc 0 (entget e2))) '("ARC" "LINE" "LWPOLYLINE"))
                 (alert "Invalid object!"))
             (vl-cmdf "_.fillet" e1 e2)
             (vl-cmdf "_.pedit"

 

Sorry.

Posted

cool, that's a quick option but it still requires me to select the one line twice. Thanks for the the tip on the *.

Posted
Walking out the door, so I can't finish, but it's basically there...

 

(defun c:CF (/ e1 e2)
 (while (and (setq e1 (entsel "\nSelect curve: "))
             (or (vl-position (cdr (assoc 0 (entget e1))) '("ARC" "LINE" "LWPOLYLINE"))
                 (alert "Invalid object!"))
             (setq e2 (entsel "\nSelect other curve: "))
             (or (vl-position (cdr (assoc 0 (entget e2))) '("ARC" "LINE" "LWPOLYLINE"))
                 (alert "Invalid object!"))
             (vl-cmdf "_.fillet" e1 e2)
             (vl-cmdf "_.pedit"

 

Sorry.

 

I'm trying this one too. I'm not that proficient in LISP's so it may take me a little while. thanks

Posted

Sorry I didn't have time to finish earlier...

 

(defun c:CF (/ e1 e2)
 (vl-load-com)
 (while (and (setq e1 (entsel "\nSelect curve: "))
             (or (vl-position (cdr (assoc 0 (entget (car e1)))) '("ARC" "LINE" "LWPOLYLINE"))
                 (alert "Invalid object!")
             ) ;_ or
             (setq e2 (entsel "\nSelect other curve: "))
             (or (vl-position (cdr (assoc 0 (entget (car e2)))) '("ARC" "LINE" "LWPOLYLINE"))
                 (alert "Invalid object!")
             ) ;_ or
             (vl-cmdf "_.fillet" e1 e2)
             (if (zerop (getvar 'peditaccept))
               (vl-cmdf "_.pedit" "_m" (ssadd (car e1) (ssadd (car e2))) "" "_y" "_j" "" "")
               (vl-cmdf "_.pedit" "_m" (ssadd (car e1) (ssadd (car e2))) "" "_j" "" "")
             ) ;_ if
        ) ;_ and
 ) ;_ while
 (princ)
) ;_ defun

Posted
Sorry I didn't have time to finish earlier...

 

(defun c:CF (/ e1 e2)
 (vl-load-com)
 (while (and (setq e1 (entsel "\nSelect curve: "))
             (or (vl-position (cdr (assoc 0 (entget (car e1)))) '("ARC" "LINE" "LWPOLYLINE"))
                 (alert "Invalid object!")
             ) ;_ or
             (setq e2 (entsel "\nSelect other curve: "))
             (or (vl-position (cdr (assoc 0 (entget (car e2)))) '("ARC" "LINE" "LWPOLYLINE"))
                 (alert "Invalid object!")
             ) ;_ or
             (vl-cmdf "_.fillet" e1 e2)
             (if (zerop (getvar 'peditaccept))
               (vl-cmdf "_.pedit" "_m" (ssadd (car e1) (ssadd (car e2))) "" "_y" "_j" "" "")
               (vl-cmdf "_.pedit" "_m" (ssadd (car e1) (ssadd (car e2))) "" "_j" "" "")
             ) ;_ if
        ) ;_ and
 ) ;_ while
 (princ)
) ;_ defun

 

This works similar to adding the "*" to the comand. It is nicer in that it makes the new line a polyline. That part is cool. Here is what i have in mind tho. Capture.jpg I would like to be able to select the lines (in exhibit A) 7, A, 6, B, 5, C....etc. to achieve polyline stair pattern in exhibit B by only selecting those lines with one click in sequence. Currently I have to click 7 then A, A again then 6, 6 again then B and so forth. Does this make sence?

 

I do appreciate your help. Thanks

Posted
This works similar to adding the "*" to the comand. It is nicer in that it makes the new line a polyline. That part is cool. Here is what i have in mind tho. [ATTACH]18203[/ATTACH] I would like to be able to select the lines (in exhibit A) 7, A, 6, B, 5, C....etc. to achieve polyline stair pattern in exhibit B by only selecting those lines with one click in sequence. Currently I have to click 7 then A, A again then 6, 6 again then B and so forth. Does this make sence?

 

I do appreciate your help. Thanks

You're welcome. It does what you asked.

Posted

You could draw a line over all the lines and then calculate the intersection point of each crossing line do a sort based on line length from start to new point.

 

Then its just fillet pt1 pt2, pt1=pt2, new pt2, fillet pt1 pt2 etc

 

I have done this for autodimensioning of house plan walls sorry code is copyright but can help if possible.

Posted
You're welcome. It does what you asked.

 

Good morning. I must not know how to use it then because I can only get it to work by clicking twice like I've described above.I will keep playing with it.

 

Aaron

Posted
Good morning. I must not know how to use it then because I can only get it to work by clicking twice like I've described above.I will keep playing with it.

 

Aaron

 

Isn't that what you originally asked for?

Posted
Isn't that what you originally asked for?

 

is it possible for the command to recognize the line selected in the last fillet and reuse it for the next fillet? I currently have to click the same line twice. I'm trying to eliminate one extra click in a string of fillets. The rest of the command works great.

Posted
is it possible for the command to recognize the line selected in the last fillet and reuse it for the next fillet? I currently have to click the same line twice. I'm trying to eliminate one extra click in a string of fillets. The rest of the command works great.

 

Maybe something like this...

 

(defun c:CF (/ e1 e2 lst ss)
 (vl-load-com)
 (while
   (and (or lst
            (and (setq e1 (entsel "\nSelect curve: "))
                 (or (vl-position (cdr (assoc 0 (entget (car e1)))) '("ARC" "LINE" "LWPOLYLINE"))
                     (alert "Invalid object!")
                 ) ;_ or
                 (setq lst (cons e1 lst))
            ) ;_ and
        ) ;_ or
        (setq e2 (entsel "\nSelect next curve: "))
        (or (vl-position (cdr (assoc 0 (entget (car e2)))) '("ARC" "LINE" "LWPOLYLINE"))
            (alert "Invalid object!")
        ) ;_ or
        (setq lst (cons e2 lst))
        (vl-cmdf "_.fillet" (cadr lst) (car lst))
   ) ;_ and
 ) ;_ while
 (setq ss (ssadd))
 (foreach x lst (setq ss (ssadd (car x) ss)))
 (if (zerop (getvar 'peditaccept))
   (vl-cmdf "_.pedit" "_m" ss "" "_y" "_j" "" "")
   (vl-cmdf "_.pedit" "_m" ss "" "_j" "" "")
 ) ;_ if
 (princ)
) ;_ defun

Posted
Maybe something like this...

 

(defun c:CF (/ e1 e2 lst ss)
 (vl-load-com)
 (while
   (and (or lst
            (and (setq e1 (entsel "\nSelect curve: "))
                 (or (vl-position (cdr (assoc 0 (entget (car e1)))) '("ARC" "LINE" "LWPOLYLINE"))
                     (alert "Invalid object!")
                 ) ;_ or
                 (setq lst (cons e1 lst))
            ) ;_ and
        ) ;_ or
        (setq e2 (entsel "\nSelect next curve: "))
        (or (vl-position (cdr (assoc 0 (entget (car e2)))) '("ARC" "LINE" "LWPOLYLINE"))
            (alert "Invalid object!")
        ) ;_ or
        (setq lst (cons e2 lst))
        (vl-cmdf "_.fillet" (cadr lst) (car lst))
   ) ;_ and
 ) ;_ while
 (setq ss (ssadd))
 (foreach x lst (setq ss (ssadd (car x) ss)))
 (if (zerop (getvar 'peditaccept))
   (vl-cmdf "_.pedit" "_m" ss "" "_y" "_j" "" "")
   (vl-cmdf "_.pedit" "_m" ss "" "_j" "" "")
 ) ;_ if
 (princ)
) ;_ defun

 

Wow, you really write that stuff fast. This one works good for the fillet. I have some ideas for the mods (polyline yes / no option and select radius) but that can be later. Thanks for your help.

Posted
Wow, you really write that stuff fast. This one works good for the fillet. I have some ideas for the mods (polyline yes / no option and select radius) but that can be later. Thanks for your help.

 

 

(defun c:CF (/ e1 e2 lst lst2 ss)
 (setvar 'filletrad
         (cond ((getdist (strcat "\nSpecify fillet radius <" (rtos (getvar 'filletrad)) ">: ")))
               ((getvar 'filletrad))
         ) ;_ cond
 ) ;_ setvar
 (while
   (and (or lst
            (and (setq e1 (entsel "\nSelect curve: "))
                 (or (vl-position (cdr (assoc 0 (entget (car e1)))) '("ARC" "LINE" "LWPOLYLINE"))
                     (alert "Invalid object!")
                 ) ;_ or
                 (setq lst (cons e1 lst))
            ) ;_ and
        ) ;_ or
        (setq e2 (entsel "\nSelect next curve: "))
        (or (vl-position (cdr (assoc 0 (entget (car e2)))) '("ARC" "LINE" "LWPOLYLINE"))
            (alert "Invalid object!")
        ) ;_ or
        (setq lst (cons e2 lst))
        (vl-cmdf "_.fillet" (cadr lst) (car lst))
        (or (zerop (getvar 'filletrad)) (setq lst2 (cons (list (entlast)) lst2)))
   ) ;_ and
 ) ;_ while
 (initget 0 "Yes No")
 (and (eq "Yes" (getkword "\nConvert to LWPolyline? [Yes/No] <No>: "))
      (setq ss (ssadd))
      (foreach x (append lst lst2) (setq ss (ssadd (car x) ss)))
      (if (zerop (getvar 'peditaccept))
        (vl-cmdf "_.pedit" "_m" ss "" "_y" "_j" "" "")
        (vl-cmdf "_.pedit" "_m" ss "" "_j" "" "")
      ) ;_ if
 ) ;_ and
 (princ)
) ;_ defun

Posted
(defun c:CF (/ e1 e2 lst lst2 ss)
 (setvar 'filletrad
         (cond ((getdist (strcat "\nSpecify fillet radius <" (rtos (getvar 'filletrad)) ">: ")))
               ((getvar 'filletrad))
         ) ;_ cond
 ) ;_ setvar
 (while
   (and (or lst
            (and (setq e1 (entsel "\nSelect curve: "))
                 (or (vl-position (cdr (assoc 0 (entget (car e1)))) '("ARC" "LINE" "LWPOLYLINE"))
                     (alert "Invalid object!")
                 ) ;_ or
                 (setq lst (cons e1 lst))
            ) ;_ and
        ) ;_ or
        (setq e2 (entsel "\nSelect next curve: "))
        (or (vl-position (cdr (assoc 0 (entget (car e2)))) '("ARC" "LINE" "LWPOLYLINE"))
            (alert "Invalid object!")
        ) ;_ or
        (setq lst (cons e2 lst))
        (vl-cmdf "_.fillet" (cadr lst) (car lst))
        (or (zerop (getvar 'filletrad)) (setq lst2 (cons (list (entlast)) lst2)))
   ) ;_ and
 ) ;_ while
 (initget 0 "Yes No")
 (and (eq "Yes" (getkword "\nConvert to LWPolyline? [Yes/No] <No>: "))
      (setq ss (ssadd))
      (foreach x (append lst lst2) (setq ss (ssadd (car x) ss)))
      (if (zerop (getvar 'peditaccept))
        (vl-cmdf "_.pedit" "_m" ss "" "_y" "_j" "" "")
        (vl-cmdf "_.pedit" "_m" ss "" "_j" "" "")
      ) ;_ if
 ) ;_ and
 (princ)
) ;_ defun

 

That works better than I expected. It will be very useful. Thanks for your time.

Posted
That works better than I expected. It will be very useful. Thanks for your time.

 

No problem.

Posted
Nice one Alan :thumbsup:

 

You love your logical operators :)

Thanks.

HaHa, I guess it does have a few. LoL

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