stupid web interface, not sure why it sent early last time...
To figure out issues with lisp code, you open the vlide using the VLIDE command, and open your lisp.
Then set a beak point at first statement under defun, use F9 to do so, it will show a red block.
Then go Tools->Load text in editor.
then go to command line and run the command.
It will stop on the break point, use F8 and shift F8 to step through code.
It will stop on any errors.
Take the time to learn this please, it will increase your ability to do complex lisps 10 fold.
Wow - that's the best thing since sliced bread !
Now, there are no errors in my code - all layouts print perfectly when I run Autocad 14 in full graphical mode, but still nothing happens when I try to run the function using AccoreConsole..exe. Here are the steps I take to attempt to print all tabs...
1. ...\AutoCAD 2014\AccoreConsole.exe /i "C:\DEV\PrintFile\Test1.dwg
I get intro messages and then the Command: prompt
2. I type in the function definition at the Command: prompt as follows...
(defun MyPrintAllLayouts ()
(foreach lay (layoutlist)
(setvar 'CTab lay)
"Yes" ; detailed plot configuration?
"" ; layout name
"PublishToWeb PNG.pc3" ; output device name
"User 1 (8000.00 x 8000.00 Pixels)" ; paper size
"Portrait" ; plot orientation
"No" ; upside down?
"Extents" ; plot area
"Fit" ; plot scale
"Center" ; plot offset
"Yes" ; with plot styles
"." ; plot style table name . for none
"Yes" ; with lineweights
"Yes" ; scale lineweights with plot scale?
"No" ; plot paper space first?
"No" ; hide paper space objects?
"" ; file name?
"No" ; save changes?
"Yes" ; proceed with plot?
The Command: prompt returns nicely after that last parentheses is entered.
3. Command: (MyPrintAllLayouts)
Autocad should generate my PNG files after some processing delay, but instead it returns the Command: prompt immediately and generates no PNG files.
I tried a simplified form of the above function definition as follows - just to be sure it would execute SOMETHING...
Command: (defun Test1 ()
This DOES WORK - yay!
But, when I add the foreach loop - I get no output.Here is what I type for this test...
Command: (defun Test2()
(foreach lay (layoutlist)
Instead of pringing "hello" for each of the 3 layouts in my test file, it immediately returns to the Command prompt and prints nothing.
Any suggestions on how to fix/debug this?
originator of this thread here.
It's been a while now since working with accoreconsol... If I recall correctly, you cannot run the lisp 'command' function. The consol wants the command straight away. However, I would be fairly certain if you couldn't run a lisp that would create a plot script... then start accoreconsol from a batch that calls the plot script.
You need to set up a lisp, then try that lisp on an open drawing to get it debugged.
Then try the function on console.
To jump to console and try to debug is nuts. Its only useful for seeing if basic things will or will not work.
It does seem you can do graphical things so long as you use command prompt to specify values.
I can see this generating a whole lot of junky automation, where the scripting of commands does stuff programmers do better.
ALSO, AUTODESK.....here we go again with why a command line interpreted language like lisp is so valuable.
That must have hurt making something that increased the usefullness of lisp
it does indeed, fascinating, as Spock once said.
It saves electrons too, as one little slash is less than 4!
Indeed! - three fewer keypresses for every getvar/setvar expression - it all adds up
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.