Update FC.LSP routine, Please?

Discussion in 'AutoCAD' started by Pat, Sep 23, 2004.

  1. Pat

    Pat Guest

    Dean,



    You wrote this, how can I change it to work w/ Autocad 2004? It worked in
    2000i but not in 2004. I don't know lisp so I don't know what to look for.
    The error says "misplaced dot". I can hardly live without this routine.



    Thanks so very, very much!





    ;Tip1374.LSP: FC.LSP Offset Line to Center (Dean Saadallah)



    (defun C:FC (/ OS CL CD LAYR PT1 PT2 PT3 DST1 DST2)

    (setq OS (getvar "OSMODE"))

    (setq CL (getvar "CLAYER"))

    (setq CD (getvar "CMDECHO"))

    (setvar "CMDECHO" 0)

    (princ "\nTarget Layer? <")

    (prin1 (read CL))

    (setq LAYR (getstring ">:"))

    (if (equal LAYR "")

    (setq LAYR (getvar "CLAYER"))

    ) ;_ end of if

    (setvar "OSMODE" 512)

    (setq PT1 (getpoint "\nPick First Line "))

    (setq PT2 PT1)

    (setvar "OSMODE" 128)

    (setq PT3 (getpoint PT1 "\nPick Second Line "))

    (setvar "OSMODE" 0)

    (setq DST1 (distance PT1 PT3))

    (setq DST2 (/ DST1 2))

    (command "OFFSET" DST2 PT1 PT3 "")

    (command "CHPROP" "L" "" "LA" LAYR

    "LT" "BYLAYER" "C" "BYLAYER" ""

    ) ;_ end of command

    (setvar "OSMODE" OS)

    (setvar "CMDECHO" CD)

    ) ;_ end of defun
     
    Pat, Sep 23, 2004
    #1
  2. Pat

    Jim Claypool Guest

    There is thohing to change for 2004. It works for me.
     
    Jim Claypool, Sep 23, 2004
    #2
  3. Pat

    T.Willey Guest

    Worked here and I'm on 2K4.

    Tim
     
    T.Willey, Sep 23, 2004
    #3
  4. Pat

    Fatfreek Guest

    Works for me using ver. 2005

    At the layer prompt are you typing exactly the name of an existing layer?

    Len
     
    Fatfreek, Sep 28, 2004
    #4
  5. Pat

    Pat Guest

    No, I don't type anything. Routine automatically throws the entity on the
    current layer.
     
    Pat, Oct 7, 2004
    #5
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.