We have drawings with multiple layouts and we want to export all these layouts to one pdf file with the accoreconsole.
I found this to use:
(setq CurrDwgName (getvar "dwgname"))
(setq Fname (substr CurrDwgName 1 (- (strlen CurrDwgName) 4)))
(setq name (strcat (getvar "DWGPREFIX") Fname ".pdf"))
;Command:
-EXPORT
;type
PDF
;What to print
A
;Enter file name <D:\FtpRoot\WorkerShared\w11i1j11\acad_test-Model.pdf>:
!name
nil
But this doesn't work. The log file of the accoreconsole is giving this as an error:
Command: -EXPORT
Enter file format [Dwf/dwfX/Pdf] <Pdf>PDF
Enter plot area [Display/Extents/Window] <Display>: A
Invalid option keyword.
I don't know how to solve this and de accoreconsole keeps on failing on all my testings.
Can someone help me with this?
Solved! Go to Solution.
Solved by ruben.vanveerdeghem. Go to Solution.
@ruben.vanveerdeghem wrote:Enter plot area [Display/Extents/Window] <Display>: A Invalid option keyword.
The option for this prompt can only be either of the three available answer
Enter plot area [Display/Extents/Window] <Display>:
The script shows "A" , you can try changing that to "E" or "D"
HTH
Any reason why you want this via coreconsole? I would suggest you use "publish" inside AutoCAD,
Separate drawing files / multiple layouts can be merged into one pdf via publish dialog
HTH
It should be using a bat file to create the pdf and to import the pdf to windchill. But I think I found the issue.
If you first make the first layout active with:
Layout
Set
Name of the first layout
Then the export command is working like it should be.
I'm only having an issue with inquiring the name of the first layout. Is there a command for that?
I was able to save this problem.
If the first layout is set, accoreconsole is able to export all layouts to pdf.
(setq CurrDwgName (getvar "dwgname"))
(setq Fname (substr CurrDwgName 1 (- (strlen CurrDwgName) 4)))
(setq name (strcat (getvar "DWGPREFIX") Fname ".pdf"))
(setq Lname (nth 0 (layoutlist)))
;Command:
LAYOUT
;Set
Set
;Select
!Lname
;Command:
-EXPORT
;type
PDF
;What to print
A
;Enter file name <D:\FtpRoot\WorkerShared\w11i1j11\acad_test-Model.pdf>:
!name
nil
My apologies, but this all seems foolish to me.
I suggest that you learn how to use SheetSetManager instead.
John F. Uhden
Ok click a menu button enter the layout plot range required hey pdfs are plotted then Ghostscript joins them back into 1 PDF been doing it for years, yes need ghostscript, no need to learn more than 1 menu button click.
You could add a startapp as last line something like (startapp "explorer" "D:\\acadtemp\\trip-Model.pdf")
I have though about do a All or range inside existing code.
After using this for the day. It looks like the last thing that happens is the ghostscript processing, so the lisp is already done. So running action on a file that is technically created by ghostscript after the fact is problemmatic. I made it open the folder in explorer at he end, this is super cool!
I'm wondering about deleting the separate files used to create the combined file, but this is probably the same issue since ghostscript works after the lisp (I think).
Yeah the ghostscript is ran as a last step as its a seperate program that has the ability to merge pdfs into 1 file. I have just had problems with publish and also with mine select from menu all done with publish have to set up and make sure everything is set correct, yes could make dsd file. So need that for each DWG also.
As the lisp has a list of pdfnames could do a VL delete file.
I have been unable to get vl-copy or vl-delete to work. Also, not sure how that works if I plot just one tab??
Been away a few days, so Vl-file-delete ? If pdf count is greater than 1 then delete files after running ghostscript.
Hello,
So I modified the program to meet my needs. It leaves a temp folder behind, but it puts the created pdf in a quickplots folder.
I have a little .bat file that cleans our server of bak files so I added the temp folders to that and it is no big deal.
I have attached the lisp so you can see what I did. And again, thank you so much.
Can't find what you're looking for? Ask the community or share your knowledge.