Results 1 to 9 of 9

Thread: Lisp routine in a Lisp routine

  1. #1
    Active Member
    Join Date
    2013-03
    Location
    Permian Basin
    Posts
    76
    Login to Give a bone
    0

    Default Lisp routine in a Lisp routine

    Is it possible to put an already loaded lisp into another lisp routine?

  2. #2
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: Lisp routine in a Lisp routine

    Possible. Its also possible to call a LISP function from inside another LISP function (thats one of the key features of LISP), so you don't have duplicate code here there and everywhere.

  3. #3
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Lisp routine in a Lisp routine

    An example to call a lisp function that is already loaded in the drawing .

    Code:
    (c:Test)

  4. #4
    Active Member
    Join Date
    2013-03
    Location
    Permian Basin
    Posts
    76
    Login to Give a bone
    0

    Default Re: Lisp routine in a Lisp routine

    I can not get this code to function properly. Can anyone tell me what I'm doing wrong. ABBE is a lisp that will auto break the lines, and I need the code to run on the last inserted block after the insert command.

    (defun C:insertblock2 ()
    (initcommandversion)
    (command "_.insert")
    ((c:abbe)
    (princ))

  5. #5
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: Lisp routine in a Lisp routine

    That depends. If ABBE is defined as a command-line function e.g. (defun c:ABBE ( / ) ...) then you must call it as (c:ABBE). If its not a command-line function e.g. (defun ABBE ( / ) ...) then you call it as such (ABBE) with appropriate arguments if it takes any. Whether it processes the last block or not will depend on whether the function is designed to do so or not.

  6. #6
    Active Member
    Join Date
    2013-03
    Location
    Permian Basin
    Posts
    76
    Login to Give a bone
    0

    Default Re: Lisp routine in a Lisp routine

    Is it possible to use the entlast function to select the last inserted block?

  7. #7
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Lisp routine in a Lisp routine

    Quote Originally Posted by jayhay35365091 View Post
    Is it possible to use the entlast function to select the last inserted block?
    Do you think that I cheated you when I gave you the answer to use the entlast function in the following thread ?

    http://forums.augi.com/showthread.ph...=1#post1243975

  8. #8
    100 Club
    Join Date
    2015-08
    Location
    birmingham, alabama
    Posts
    131
    Login to Give a bone
    0

    Default Re: Lisp routine in a Lisp routine

    hi jayhay,
    perhaps this is what you are asking for:

    Code:
    (load "c:/path part/path part/path part/another-routine.lsp")
    then this "another-routine" and all subroutines within, are available to your current lisp routine.

    Code:
    (if (= (getvar "insunits") 4)
        (myModifyBk (list "Rebar Size"  "#13"))
        (myModifyBk (list "Rebar Size"  "#4"))
    );end-of-if
    the "mymodifybk" is a subroutine within the other loaded lisp routine.

    hope i'm helping,
    karl

  9. #9
    Member
    Join Date
    2003-06
    Posts
    8
    Login to Give a bone
    0

    Default Re: Lisp routine in a Lisp routine

    yes, it is possible.

    1) Add your support lisp directory.
    command OPTIONS

    2) Load secondary lisp into your main lisp
    (load "ADOLISP_Library.lsp")

    3) Call C:function with arguments of secondary lisp
    (ADOLISP_ConnectToDB ConnectString "admin" "")

    enjoy!

Similar Threads

  1. Calling up LISP routine from within another LISP
    By jimmy_goodall in forum AutoLISP
    Replies: 4
    Last Post: 2013-08-21, 05:56 AM
  2. NEED HELP WITH LISP ROUTINE - PURGE linetype lisp
    By ECASAOL350033 in forum AutoLISP
    Replies: 6
    Last Post: 2013-06-21, 01:13 AM
  3. Help with a lisp routine to add a 12" line to this routine
    By Orbytal.edge341183 in forum AutoLISP
    Replies: 3
    Last Post: 2012-11-14, 10:33 PM
  4. Combine three lisp routine into one routine.
    By BrianTFC in forum AutoLISP
    Replies: 1
    Last Post: 2012-02-08, 12:14 PM
  5. Replies: 9
    Last Post: 2012-01-21, 07:58 AM

Posting Permissions

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