batch plotting with accoreconsole

batch plotting with accoreconsole

Anonymous
Not applicable
1,735 Views
3 Replies
Message 1 of 4

batch plotting with accoreconsole

Anonymous
Not applicable

 

I have a handy lisp that normally run in the autocad GUI that plots all layouts in a drawing using a particular pagesetup

 

However the coreconsole does not allow me to use (command "commandname") statements inside my lisp.

 

Using just script, i can run the -plot command but this only works for the current layout of the drawing.

 

So my question is, has anyone figured out a way to use the accoreconsole to print multiple layouts in a drawing using a predefined pagesetup?

 

Here's my lisp code

 

(defun c:PLOTALL2PDF ()
(setvar "FILEDIA" 0)
(foreach lay (layoutlist)
(setvar 'CTab lay)
(COMMAND "-PLOT"
"N"
""
"PDF_arch-E"
""
"";plot to a file y/n option
"N"
"Y" )
)
(SETVAR "filedia" 1)
)
(c:plotall2pdf)(princ)

i've been calling up the lisp in my script

 

FILEDIA
0
CMDDIA
0
ATTREQ
0
(LOAD "R:/lisp/plotall2pdf.lsp")
QSAVE
FILEDIA
1
CMDDIA
1
ATTREQ
1

 

 

 

0 Likes
1,736 Views
3 Replies
Replies (3)
Message 2 of 4

dbroad
Mentor
Mentor

Accoreconsole does allow (command "commandname" ...) statements.  It does not allow for commands that require dialog box entry.

 

This is unnecessary  in accoreconsole

 

(setvar "FILEDIA" 0)

 Using a setup here, this is the command result in accoreconsole:

Spoiler
Command: (command "-plot"
(_> "n"
(_> ""
(_> "Setup1"
(_> ""
(_> ""
(_> "n"
(_> "y"
(_> )
-plot Detailed plot configuration? [Yes/No] <No>: n
Enter a layout name or [?] <Model>:
Enter a page setup name <>: Setup1 Enter an output device name or [?] <AutoCAD P
Enter a page setup name <>: Setup1 Enter an output device name or [?] <AutoCAD P
Enter a page setup name <>: Setup1 Enter an output device name or [?] <AutoCAD P
DF (General Documentation).pc3>:
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
age setup [Yes/No]? <N> n Proceed with plot [Yes/No] <Y>: y Effective plotting a
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
age setup [Yes/No]? <N> n Proceed with plot [Yes/No] <Y>: y Effective plotting a
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
age setup [Yes/No]? <N> n Proceed with plot [Yes/No] <Y>: y Effective plotting a
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
age setup [Yes/No]? <N> n Proceed with plot [Yes/No] <Y>: y Effective plotting a
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
age setup [Yes/No]? <N> n Proceed with plot [Yes/No] <Y>: y Effective plotting a
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
age setup [Yes/No]? <N> n Proceed with plot [Yes/No] <Y>: y Effective plotting a
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
age setup [Yes/No]? <N> n Proceed with plot [Yes/No] <Y>: y Effective plotting a
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
age setup [Yes/No]? <N> n Proceed with plot [Yes/No] <Y>: y Effective plotting a
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
age setup [Yes/No]? <N> n Proceed with plot [Yes/No] <Y>: y Effective plotting a
Enter file name <C:\Users\arcinst\Downloads\KJ_SD1-Model.pdf>: Save changes to p
age setup [Yes/No]? <N> n Proceed with plot [Yes/No] <Y>: y Effective plotting a
rea: 7.80 wide by 9.60 high

Plotting viewport 2.
.
ommand: nil

A plot is created.

 

Since dialog boxes are not supported, all of the statements to set and unset variables are unnecessary.  Since no error messages are generated, it may be difficult to debug problems in accoreconsole.

Most of the statements in your script are unnecessary including the save statement unless you are trying to save plot settings and page setups.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 3 of 4

Anonymous
Not applicable

The script is a default to what i use in the gui mode. If the statements are ignored in core, then that's fine. I can use the same script in gui mode or with the core. makes less confusion for my cad users and one less script to edit.

I can see it gets past the those statements and loads the lisp routine, but nothing happens after that.

 

The real issue is running the lisp in the core mode. if i CAN run (command "") based lisp routines, not sure why this isn't working?

 

It seems I'm not the only one stuck. I just found this post showing a very similar issue.

 

http://forums.autodesk.com/t5/forums/forumtopicprintpage/board-id/130/message-id/317121/print-single...

 

It seems that the loop function is what is failing for the lisp. I dont know of any other workaround. Any suggestions?

0 Likes
Message 4 of 4

dbroad
Mentor
Mentor

There are some lisp functions that don't work so just reusing your gui form of lisp isn't always going to cut it.  For example, layoutlist does not return a value in accoreconsole.  It is probably because it is an external subroutine probably loaded as part of AutoCAD not needed for non-gui processing.  So you would have to use other methods, such as activeX to create the list.

 

That the layoutlist function would not be in the core seems odd though because  lspdata.lsp, one of the express tools functions lists that function in its core-symbol-list but in the accoreconsole session (member 'layoutlist (atoms-family 0)) returns nil

Architect, Registered NC, VA, SC, & GA.
0 Likes