Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flow of execution when opening files in LISP

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
363 Views, 3 Replies

Flow of execution when opening files in LISP

In my lisp file I open a file in my LISP code using (command "._vbastmt" "ThisDrawing.Application.Documents.Open(\"FULL_PATH_NAME\")") I then want to insert a block into this file, but my lisp code seems to terminate right as the file finishes opening. How do I execute more LISP code after I make the above call to open another file?
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

You'll have to initialize the lisp
routine from VBA.If you look in the readme, it explains how to do this, but
here's a quick tour:

(command "-vbarun"
"stack2002.dvb!insertit" good:fle short_blockname)

this is an excerpt from a chunk of
code that creates a new file, inserts the old file, purges, explodes and saveas
it with the old files name.  The thing to note is that you can pass
arguments to a vba module as if you were typing them at the command
prompt.  That's what good:fle and short_blockname do.

In the vba world

    dwgname =
ThisDrawing.Utility.GetString(True, "drawing name:")
   
blockname = ThisDrawing.Utility.GetString(True, "block name:")

capture these arguments.  You
can load and pass commands to a lisp routine via the SendCommand method in
vba.  You just have to make your lisp accept and check for these arguments
to determine where in the process of execution it is.

CAD naked

John


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
In
my lisp file I open a file in my LISP code using (command "._vbastmt"
"ThisDrawing.Application.Documents.Open(\"FULL_PATH_NAME\")") I then want to
insert a block into this file, but my lisp code seems to terminate right as
the file finishes opening. How do I execute more LISP code after I make the
above call to open another file?
Message 3 of 4
vlispman
in reply to: Anonymous

Check the LispInit variable. When it true, acad.lsp was laoded at each opening of file, and it break the current Lisp execution.
Message 4 of 4
Anonymous
in reply to: Anonymous

When I want this I have my lisp write a script, run the script, then
have the script reload and execute the lisp.

goodwad wrote:

> In my lisp file I open a file in my LISP code using (command
> "._vbastmt"
> "ThisDrawing.Application.Documents.Open(\"FULL_PATH_NAME\")") I then
> want to insert a block into this file, but my lisp code seems to
> terminate right as the file finishes opening. How do I execute more
> LISP code after I make the above call to open another file?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost