Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Running Lisp

  1. #1
    Member
    Join Date
    2002-05
    Posts
    39
    Login to Give a bone
    0

    Default Running Lisp

    It is a long time since I last used lisp routines and I am having trouble making them work.

    I have a number of older lisp routines and I am now attempting to use them. I am using APPLOAD to load the lisp, however, I am now stuck on making the lisp run. From what I recall one would just type the name of the lisp routine to call it into action but that does not appear to be working.

    any help would be much appreciated.

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Running Lisp

    Depends on how the function is labeled.
    If
    (defun c:Whatever ()
    ..
    )
    Then after you load it, you would just type Whatever.
    But if it's like
    (defun Whatever ()
    ..
    )
    Then you would have to call it like (Whatever) from Acad.

    Hope that helsp.

  3. #3
    Member
    Join Date
    2002-05
    Posts
    39
    Login to Give a bone
    0

    Default Re: Running Lisp

    The function is labeled as below:-
    (defun PL_Ell2Pl( ename ), I am entering PL_Ell2Pl on the command line and getting unknown command.

    when I repeat APPLOAD the lisp I believe that I have already loaded is greyed out in the list of already loaded applications, what does this mean?

    I am getting the message that the application is successfully loaded when I load it, so I am assuming that the lisp should work and that it is not too old for my current version of AutoCAD.

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default Re: Running Lisp

    You will need to place a parenthesis around the function. But you will also need to add what looks like the entity name as well for this function to work.

    Code:
    (PL_Ell2Pl ename)
    The ename usually means the entity's name, associate code -1.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Running Lisp

    Okay. You have got a routine that needs and arguement. I was hoping that it wasn't like this, but since it is here is a little overview. When you have an opening line like:
    (defun Whatever (Arg1 Arg2 / Local1 Local2)
    ....
    This means that the routine needs to have two items supplied. You can tell because there are two variable names listed before the front slash (/). When calling these routines you have to call it like
    (Whatever Arg1 Arg2)

    You need to look at the code and see how the two variables are being used to know what they are. Or you may be able to tell by how they are labeled as in your case. This
    (defun PL_Ell2Pl( ename )
    looks like it wants an ename for this routine. Try this and see what it does. After you load your routine, copy/paste this to your command line and see what happens.

    (PL_Ell2Pl (car (entget)))

  6. #6
    All AUGI, all the time CAB2k's Avatar
    Join Date
    2016-01
    Location
    Brandon, Florida
    Posts
    687
    Login to Give a bone
    0

    Default Re: Running Lisp

    Your (PL_Ell2Pl routine is most likely a subroutine and you need to find the routine that calls it.
    As Tim said the routine you are looking for will begin with a (defun c:<routine name>
    When you find it it will be th name you type at the command line like
    command: <routine name>
    It will call (PL_Ell2Pl when it gets the user to select the object to be passed.

    So do a search in your lisp files for a routine that called (PL_Ell2Pl and if the routine begins with
    (defun c: then you can call it from the command line and see what it does.

  7. #7
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: Running Lisp

    Quote Originally Posted by CiphDRMRS
    Depends on how the function is labeled.
    If
    (defun c:Whatever ()
    ..
    )
    Then after you load it, you would just type Whatever.
    But if it's like
    (defun Whatever ()
    ..
    )
    Then you would have to call it like (Whatever) from Acad.

    Hope that helsp.
    ...and of course if there is no defun then all the code is executed as it is loaded, (or any code outside a defun)


    R.K. McSwain | CAD Panacea |

  8. #8
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Running Lisp

    Quote Originally Posted by rkmcswain
    ...and of course if there is no defun then all the code is executed as it is loaded, (or any code outside a defun)


    I always forget to mention that because I don't really code like that. Thanks for pointing that out, and reminding me about this way.

  9. #9
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: Running Lisp

    Quote Originally Posted by CiphDRMRS
    I always forget to mention that because I don't really code like that. Thanks for pointing that out, and reminding me about this way.
    I use it sometimes, depending on the situation.

    The code doesn't stay in memory and the user gets the latest copy whenever loaded/executed.
    R.K. McSwain | CAD Panacea |

  10. #10
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Running Lisp

    FastLink

    : ) Happy Computing !

    kennet


    BTW if Spline to poly lisp ? You still miss one function ; )
    Last edited by kennet.sjoberg; 2006-01-17 at 09:10 PM. Reason: BDW

Page 1 of 2 12 LastLast

Similar Threads

  1. Running a LISP routine?
    By james.matuska in forum AutoLISP
    Replies: 3
    Last Post: 2009-08-10, 11:56 AM
  2. auto running lisp
    By PHOTOS4ME in forum AutoLISP
    Replies: 3
    Last Post: 2009-07-31, 07:21 PM
  3. Running Lisp from within a script
    By sthedens in forum AutoLISP
    Replies: 42
    Last Post: 2006-01-30, 06:42 AM
  4. lisp for running macro
    By chrisw.94380 in forum AutoLISP
    Replies: 1
    Last Post: 2005-10-28, 08:45 PM
  5. Running a lisp routine from VBA
    By bbates.81026 in forum VBA/COM Interop
    Replies: 1
    Last Post: 2005-08-18, 02:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •