Lisp Program

Discussion in 'AutoCAD' started by George, Sep 10, 2004.

  1. George

    George Guest

    I use the Offset command alot with a 3 1/2" offset. I loaded this lisp
    program but it does not come up when I type myoffset in the command line.
    I saved this program in word pad as a lsp file and pasted in autocads
    support folder. I then went to tools/load applications and loaded it.
    Does anyone know what I am doing wrong.

    (defun c:myoffset ()
    (setvar "offsetdist" 3.5)
    (command "._offset" "")
    (princ)
    )

    Thank You, George
     
    George, Sep 10, 2004
    #1
  2. George

    CAB2k Guest

    Works for me..
    When you Load it it will only work in the current drawing & must be reloaded if you change drawings.
     
    CAB2k, Sep 10, 2004
    #2
  3. One method is to create a file called acaddoc.lsp in an AutoCAD support
    folder -
    either add your program inside this file
    or add this line to the acaddoc.lsp file - (load "NameOfYourLispFile") -
    subsituting your file name
    Then the program will load each time a drawing is opened
     
    Alan Henderson @ A'cad Solutions, Sep 10, 2004
    #3
  4. George

    BillZ Guest

    Did you name the file "myoffset.lsp" ?

    After loading the file, you call it with the filename.




    Bill
     
    BillZ, Sep 10, 2004
    #4
  5. George

    Chip Harper Guest

    After you load it you need to RUN it ...

    (load "myoffset") <enter>
    myoffset<enter>
     
    Chip Harper, Sep 10, 2004
    #5
  6. George

    Doug Broad Guest

    Did you save it in word or ascii format. AutoCAD only
    reads ASCII. Suggest you use VLIDE or Notepad if
    that is the problem.
     
    Doug Broad, Sep 10, 2004
    #6
  7. George

    George Guest

    How did you load it?

    reloaded if you change drawings.
     
    George, Sep 10, 2004
    #7
  8. George

    Rick Keller Guest

    George,

    You load the filename... (load"myoffset")

    Then you run the function by typing myoffset at the command prompt.

    The file name does not have to be the same as the defun c:myoffset.

    Example... you can save your lisp as abc.lsp then you would load
    (load"abc") but still type myoffset at the command prompt.


    Rick
     
    Rick Keller, Sep 10, 2004
    #8
  9. George

    CAB2k Guest

    I used VLIDE to load it but it should not matter.
    Add it to your Start Up Suite & it should be there for all drawings.
     
    CAB2k, Sep 10, 2004
    #9
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.