Previous Plot LISP with AutoCAD PDF

Previous Plot LISP with AutoCAD PDF

nrz13
Advisor Advisor
2,263 Views
9 Replies
Message 1 of 10

Previous Plot LISP with AutoCAD PDF

nrz13
Advisor
Advisor

We have used the following LISP routine in our office for years with numerous printers, including the Adobe PDF driver, without issue.  Since upgrading to 2016 and using the new AutoCAD 2016 PDF driver, the script has sort of broken down. I would like to know if there's a way to modify this script to use to print the previous plot for all printers.

This is what works for everything but AutoCAD 2016 PDF.  When creating an Adobe PDF it prompts for a PDF file name and location.
(DEFUN C:8 ()(COMMAND "-PLOT" "" "" "PREVIOUS PLOT" "" "" "" "")(PRINC))

The undesired behavior when using it with the AutoCAD 2016 PDF driver is that it doesn't prompt for a file name or location; it just saves it to the same directory as the .dwg file with whatever name the layout has.  However, when I manually enter "-PLOT", etc., it does give me a prompt for name and location.  Adding a pause to the script also didn't seem to help.

Is this possible to do without setting up a new Previous Plot command for AutoCAD 2016 PDF prints?


***EDIT***
Sorry, I meant to post this is the Customization forum, if a moderator could move it for me.


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
2,264 Views
9 Replies
Replies (9)
Message 2 of 10

hmsilva
Mentor
Mentor

Try

untested

(DEFUN C:8 ()(COMMAND "-PLOT" "" "" "PREVIOUS PLOT" "" "~" "" "")(PRINC))

 

Hope this helps,
Henrique

EESignature

Message 3 of 10

nrz13
Advisor
Advisor

hmsilva:  thanks for your reply!

The tilde is a new one for me.  Adding it mostly fixed the AutoCAD 2016 PDF previous plot issue, but broke it for our other printers.  With the AutoCAD 2016 PDF it prompts for a file name and location, which is good, but doesn't remember the last location the file was saved in.  Every time I run the script it goes back to the directory where the .dwg is instead of the last-saved directory.

I'm guessing that Adobe has sorted all this out in their own code to make it work with that driver.  Maybe Autodesk will eventually do the same?  Or perhaps there's a less basic routine that could account for the differences between a normal printer and a PDF driver?


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 4 of 10

hmsilva
Mentor
Mentor

@nrz13 wrote:

hmsilva:  thanks for your reply!

The tilde is a new one for me.  Adding it mostly fixed the AutoCAD 2016 PDF previous plot issue, but broke it for our other printers.  With the AutoCAD 2016 PDF it prompts for a file name and location, which is good, but doesn't remember the last location the file was saved in.  Every time I run the script it goes back to the directory where the .dwg is instead of the last-saved directory.

I'm guessing that Adobe has sorted all this out in their own code to make it work with that driver.  Maybe Autodesk will eventually do the same?  Or perhaps there's a less basic routine that could account for the differences between a normal printer and a PDF driver?


You're welcome, nrz13!


When I suggested to use a tild to force the dialog box, I thought 'c:8' function was just to plot to .pdf...

Concerning to AutoCAD 2016 PDF I can't test it at the moment... this laptop is too old...

A different routine, probably will do the trick, but it will still remain the 'doesn't remember the last location the file was saved in.'

 


Henrique

EESignature

0 Likes
Message 5 of 10

nrz13
Advisor
Advisor

A more advanced script is beyond me, so until someone comes along with a way to merge the two into one, I'll have to live with using separate commands and moving the files to the correct directory after creating them.


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 6 of 10

hmsilva
Mentor
Mentor

@nrz13 wrote:

A more advanced script is beyond me, so until someone comes along with a way to merge the two into one, I'll have to live with using separate commands and moving the files to the correct directory after creating them.


Hi nrz13,

maybe someone else might provide a simpler solution, but in the meantime this solution may do the trick...

(only tested in an old AutoCAD version)

 

Hope this helps,
Henrique

 

 

Edited by request
Discussion_Admin

EESignature

0 Likes
Message 7 of 10

nrz13
Advisor
Advisor

Henrique:

Thanks for your continued efforts.  Unfortunately, that doesn't work either.  For non-AutoCAD 2016 PDF plots, it breaks down, prompting me for extra inputs.  For all plots, it prompts me for a save location twice (two separate dialogs) and it doesn't remember the last saved directory either.  : \


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 8 of 10

hmsilva
Mentor
Mentor

@nrz13 wrote:

Henrique:

Thanks for your continued efforts.  Unfortunately, that doesn't work either.  For non-AutoCAD 2016 PDF plots, it breaks down, prompting me for extra inputs.  For all plots, it prompts me for a save location twice (two separate dialogs) and it doesn't remember the last saved directory either.  : \


Unfortunately the registry key that the code reads, It is not immediately updated... 😞

If I find a different solution, I'll post here.

 

Henrique

EESignature

0 Likes
Message 9 of 10

nrz13
Advisor
Advisor
Thanks again

Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 10 of 10

diepkhoi90
Contributor
Contributor
Thank mate, it's works very well
0 Likes