fillet & pline

Discussion in 'AutoCAD' started by Oak3s, Mar 6, 2004.

  1. Oak3s

    Oak3s Guest

    i trying to fillet two lines and have them become one pline when the routine is finished. so far ive found a problem. when the first line selected is a pline the routine errors out. i had it working if it wasnt a pline. now im trying to write a 'if' statement but im not sure how to. if the line is a pline i want it to go straight to the fillet command. if the line is not a pline then i want it to make it one, then do the fillet command. i would appreciate any help or ideas.
    thanks
    Jeremy

    (defun c:ff (/ FLR OBJ1 OBJ2 OBJ1L OBJ2L)
    (setq FLR(getvar "filletrad"))
    (setq OBJ1 (entsel "\nSelect Line: "))
    (setq OBJ2 (entsel "\nSelect Second Line: "))
    ;
    ; ***List of Selected Lines***
    ;
    (setq OBJ1L (car OBJ1))
    (setq OBJ2L (car OBJ2))

    (command "fillet" "radius" 0 "") ; Set radius of fillet to 0
    ;
    ; ***************************************************************
    ;
    ; If the first line is not a pline, make it one.
    ; If it is not a pline then continue the command.
    ;
    (if
    (/= "pline" OBJ1)
    (command "._pedit" "y" "")
    (command "fillet" OBJ1 OBJ2)
    )
    (if
    (= "pline" OBJ1)
    (command "fillet" OBJ1 OBJ2)
    )
    (setvar "filletrad" FLR)
    )
     
    Oak3s, Mar 6, 2004
    #1
  2. Oak3s

    TCEBob Guest

    Problem is, you can't fillet two plines (despite what help says.) So if
    you start with a pline and a line and then convert the line to a pline
    it won't work. If your goal is to join two items into one pline I
    suggest you look up pedit/multiple/join and Peditaccept.

    Here is the one I use:

    (defun c:j( / ff) ;Pline join ffac is global
    (setvar "peditaccept" 1)
    (setq ffac (if ffac ffac 1)) ;make sure ffac has a value
    (if (setq ff(getreal(strcat "Fuzz factor: <" (rtos ffac) ">: ")))
    (setq ffac ff) ;if the setq failed the user hit enter, so keep ffac
    )
    (while
    (setq sset(ssget))
    (command "pedit" "m" sset "" "j" "j" "b" ffac "")
    (setq sset nil)
    )
    (princ))

    routine is finished. so far ive found a problem. when the first line
    selected is a pline the routine errors out. i had it working if it wasnt
    a pline. now im trying to write a 'if' statement but im not sure how to.
    if the line is a pline i want it to go straight to the fillet command.
    if the line is not a pline then i want it to make it one, then do the
    fillet command. i would appreciate any help or ideas.
     
    TCEBob, Mar 6, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.