Is it possible to put an already loaded lisp into another lisp routine?
|
Is it possible to put an already loaded lisp into another 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.
An example to call a lisp function that is already loaded in the drawing .
Code:(c:Test)
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))
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.
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
hi jayhay,
perhaps this is what you are asking for:
then this "another-routine" and all subroutines within, are available to your current lisp routine.Code:(load "c:/path part/path part/path part/another-routine.lsp")
the "mymodifybk" is a subroutine within the other loaded lisp routine.Code:(if (= (getvar "insunits") 4) (myModifyBk (list "Rebar Size" "#13")) (myModifyBk (list "Rebar Size" "#4")) );end-of-if
hope i'm helping,
karl
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!