The command linkesd to lisp is not recognized in to command line of AutoCAD

The command linkesd to lisp is not recognized in to command line of AutoCAD

vanderlei.siqueira55NDB
Participant Participant
618 Views
7 Replies
Message 1 of 8

The command linkesd to lisp is not recognized in to command line of AutoCAD

vanderlei.siqueira55NDB
Participant
Participant

The command linked to lisp that I created as an example (defun c:VAS ()
is not recognized via the script that calls it vas.lsp
However, when I run the VAS command from the AutoCAD command line, it runs the tasks placed in it normally.
Can anyone help me where the problem is?

I already entered ._vas with -vas with ".-vas" but nothing worked...

0 Likes
619 Views
7 Replies
Replies (7)
Message 2 of 8

thaydenCJMLL
Contributor
Contributor

Within the script, use (C:VAS)   .... assuming the vas.lsp is already loaded in your drawing first.

Message 3 of 8

Kent1Cooper
Consultant
Consultant

To run it from within other AutoLisp code, the (C:VAS) approach would be the way.  But in a Script [assuming you mean what AutoCAD means by that -- a .scr file run with the SCRIPT command], or in a command macro, just plain VAS should do it.  But it could be affected by what that command does.  You would not be able to feed arguments to it if it needs input, but if it needs input and is the last thing in the Script, it could be called and then you will be left in it to continue.

The underscore prefix is for English command names to be usable in AutoCAD for other languages, so that doesn't apply.  The period prefix is to force use of a native AutoCAD command if the command name may have been redefined, so it doesn't apply.  They hyphen prefix is to use the command-line version of a command that has a dialog box, so it doesn't apply.

Kent Cooper, AIA
Message 4 of 8

pkenewell6347
Advocate
Advocate

Are you loading the "vas.lsp" into every drawing, either from the Startup Suite, acaddoc.lsp, or by including (load "vas.lsp") into the script?

Message 5 of 8

john.uhden
Mentor
Mentor

@Kent1Cooper ,

Thank you for that always sound explanation.

However, he could use it in the middle of a script, even if it requires input, by adding the following before any code that invokes it...

(vlax-add-cmd "VAS" 'c:VAS)

 That way it becomes an AutoCAD command.

John F. Uhden

Message 6 of 8

vanderlei.siqueira55NDB
Participant
Participant
Hello everyone, I missed completing my question (right at the beginning, for a better general understanding), my final need is for Accoreconsole to perform tasks automatically "outside AutoCad", that is;
A batch file vas.bat calls the script vas.scr which in turn runs the lisp vas.lsp
And the Batch file also has the function of going through all *.dwg files.

When executing the vas.scr script (loading it via the autocad command line) it runs vas.lisp perfectly, since the lisp file is already inside the startup suite.

So, my problem is not being able to run the vas.scr file automatically outside of AutoCAD, this is my failure.
I kindly ask for your help, masters...
 
vanderleisiqueira55NDB_0-1719404847435.png

 

 
 
 
 
 
0 Likes
Message 7 of 8

ec-cad
Collaborator
Collaborator

Look in this forum for a Lisp(s) that build a .scr file, many samples.

Select the drawings you need to process. Build the script like, this

 

Open drawingname

(load "c:\\path\\vas.lsp")

VAS

qsave

Open next drawingname..

 

Run AcCoreConsole.exe with the /s option to specify a script.

 

ECCAD

 

Message 8 of 8

ec-cad
Collaborator
Collaborator

 

Try this Bscript.lsp to build a script. Load it in regular Acad session, type in the drive/path/lispfilename.lsp

(include the .lsp), and input a Command to call e.g. VAS in your case. It uses Browse for Folder, but

doesn't show you a list of the .dwg's there, so just double-click on the folder. Makes a script called

C:\scripts\script.scr  (makes the folder). Cannot test it here with no accoreconsole, so you may have

to tune the section (defun do_script () ... to build the script correctly for that session.

 

ECCAD

0 Likes