Fatal Error: Unhandled Access Violation Reading 0x86e0 Exception at 3b01ae95h When Running .bat

Fatal Error: Unhandled Access Violation Reading 0x86e0 Exception at 3b01ae95h When Running .bat

whitt0213
Contributor Contributor
1,140 Views
14 Replies
Message 1 of 15

Fatal Error: Unhandled Access Violation Reading 0x86e0 Exception at 3b01ae95h When Running .bat

whitt0213
Contributor
Contributor

I have a script that runs in the accoreconsole via a .bat file. The script creates a .dsd file and then batch plots to .pdf (publish) using the .dsd file. However, whenever it gets to the publish command in the script, I get the following:

 

 

Command: (command "-PUBLISH" dsdpath)
PUBLISH Enter name of sheet list <>: S:\Folder\Subfolder1\Subfolder2\Subfolder3\Subfolder4\batchdsd.dsd Loading AEC Base...


Regenerating model.



Command:
Command: Effective plotting area:  8.11 wide by 10.94 high

Plotting viewport 2.

************************MessageBox****************************
AutoCAD Error Aborting


FATAL ERROR:  Unhandled Access Violation Reading 0x86e0 Exception at 3b01ae95h


>>>Responding: OK.
**************************************************************

 

 

The script runs fine when I have defined it inside a command (defun) and manually drag and drop onto a drawing in AutoCAD, then call the command. The script doesn't work when I try to run it outside of defun and I receive the same error as above. The computer is a work computer which is managed by IT department. Any ideas what could be causing this or what a solution may be?

0 Likes
1,141 Views
14 Replies
Replies (14)
Message 2 of 15

paullimapa
Mentor
Mentor

Does the error only occur on this computer or on other computers also?

Does it only occur on a specific dwg?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 15

whitt0213
Contributor
Contributor

I have tried it on two separate computers and get the same error. I've also tried on multiple drawings, in multiple folder locations, both on the network and on my C: drive and get the same error. 

0 Likes
Message 4 of 15

paullimapa
Mentor
Mentor

If you’ve already turned off background plotting on the publish window and the error still occurs then perhaps it’s time to submit a report to Autodesk on this error

https://www.autodesk.com/support/contact-support


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 15

whitt0213
Contributor
Contributor

Hmm, is background plotting a setting I need to adjust in my .dsd file? Below are my script and batch file, if you have the time, I'd love a second set of eyes to make sure I haven't made any syntax errors or missing any arguments. 

 

Script: 

  (setq OldFda (getvar "FILEDIA"))
  (setvar "FILEDIA" 0)

  (setq dwg-folder "S:\\Folder\\Subfolder1\\Subfolder2\\Subfolder3\\Subfolder4\\")
  (setq files (vl-directory-files dwg-folder "*.dwg" 1))
  
  (setq dsdpath (strcat dwg-folder "batchdsd.dsd"))
  (setq dsdfile (open (strcat dwg-folder "batchdsd.dsd") "w"))

  (write-line "[DWF6Version]" dsdfile)
  (write-line "Ver=1" dsdfile)
  (write-line "[DWF6MinorVersion]" dsdfile)
  (write-line "MinorVer=1" dsdfile)

  (foreach file files
    (setq filename (vl-filename-base file))
    (write-line (strcat "[DWF6Sheet:" filename "-Model" "]") dsdfile)
    (write-line (strcat "DWG=" dwg-folder filename ".dwg") dsdfile)
    (write-line "Layout=Model" dsdfile)
    (write-line "Setup=Monroe Iso Batch Plot dsdfile")
    (write-line (strcat "OriginalSheetPath=" dwg-folder filename ".dwg") dsdfile)
    (write-line "Has Plot Port=0" dsdfile)
    (write-line "Has3DDWF=0" dsdfile)
  )

  (write-line "[Target]" dsdfile)
  (write-line "Type=6" dsdfile)
  (write-line (strcat "DWF=" dwg-folder filename ".dwf") dsdfile)
  (write-line (strcat "OUT=" dwg-folder) dsdfile)
  (write-line "PWD=" dsdfile)

  (write-line "[PdfOptions]" dsdfile)
  (write-line "IncludeHyperlinks=TRUE" dsdfile)
  (write-line "CreateBookmarks=TRUE" dsdfile)
  (write-line "CaptureFontsInDrawing=TRUE" dsdfile)
  (write-line "ConvertTextToGeometry=FALSE" dsdfile)
  (write-line "VectorResolution=1200" dsdfile)
  (write-line "RasterResolution=400" dsdfile)

  (close dsdfile)

  (command "_.delay" 2000)
  (if files
    (progn
        (command "-PUBLISH" dsdpath)
      (princ "Publishing completed.")
    )
    (princ "No DWG files found in the specified folder.")
  )

  (setvar "FILEDIA" OldFda)

  (princ)

 

Batch:

cd "C:\Program Files\Autodesk\AutoCAD 2016"
c:
cls
accoreconsole.exe /i "S:\Folder\Subfolder1\Subfolder2\Subfolder3\Subfolder4\test.dwg" /s "S:\Folder\Subfolder1\Subfolder2\Subfolder3\Subfolder4\printPDF.scr"
PAUSE

 

Thanks for your help.

0 Likes
Message 6 of 15

paullimapa
Mentor
Mentor

this is the setting in the Publish window

paullimapa_0-1712936726491.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 7 of 15

whitt0213
Contributor
Contributor

I'm familiar with that field, but I'm not sure how to toggle it/or if it is necessary to toggle it within my script or .dsd creation. 

0 Likes
Message 8 of 15

paullimapa
Mentor
Mentor

if it's already untoggled then that's all that needs to be done


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 9 of 15

whitt0213
Contributor
Contributor
Okay thanks. Do you see any issues with my script or batch file?
0 Likes
Message 10 of 15

paullimapa
Mentor
Mentor

if it works in AutoCAD but crashes in coreconsole then something else is going on. I don't see anything out of the oridinary.

Might as well also set this too under Options > Plot & Publish:

paullimapa_0-1712937375793.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 11 of 15

whitt0213
Contributor
Contributor

I misspoke earlier. When I have the script defined within a defun (see below) and then call the command in AutoCAD, it works perfect. When I remove the defun and drag and drop on drawing, it does not work. Any idea why that would be happening? Or, how can I just call the printPDF command from my batch file?

(defun c:printpdf()
  ;; Ignore pop-ups
  (setq OldFda (getvar "FILEDIA"))
  (setvar "FILEDIA" 0)

  ;; Get File location and files
  (setq dwg-folder "S:\\Folder\\Subfolder1\\Subfolder2\\Subfolder3\\Subfolder4\\")
  (setq files (vl-directory-files dwg-folder "*.dwg" 1))
  
  ;; Create dsd file
  (setq dsdpath (strcat dwg-folder "batchdsd.dsd"))
  (setq dsdfile (open (strcat dwg-folder "batchdsd.dsd") "w"))

  (write-line "[DWF6Version]" dsdfile)
  (write-line "Ver=1" dsdfile)
  (write-line "[DWF6MinorVersion]" dsdfile)
  (write-line "MinorVer=1" dsdfile)

  (foreach file files
    (setq filename (vl-filename-base file))
    (write-line (strcat "[DWF6Sheet:" filename "-Model" "]") dsdfile)
    (write-line (strcat "DWG=" dwg-folder filename ".dwg") dsdfile)
    (write-line "Layout=Model" dsdfile)
    (write-line "Setup=Monroe Iso Batch Plot dsdfile")
    (write-line (strcat "OriginalSheetPath=" dwg-folder filename ".dwg") dsdfile)
    (write-line "Has Plot Port=0" dsdfile)
    (write-line "Has3DDWF=0" dsdfile)
  )

  (write-line "[Target]" dsdfile)
  (write-line "Type=6" dsdfile)
  (write-line (strcat "DWF=" dwg-folder filename ".dwf") dsdfile)
  (write-line (strcat "OUT=" dwg-folder) dsdfile)
  (write-line "PWD=" dsdfile)

  (write-line "[PdfOptions]" dsdfile)
  (write-line "IncludeHyperlinks=TRUE" dsdfile)
  (write-line "CreateBookmarks=TRUE" dsdfile)
  (write-line "CaptureFontsInDrawing=TRUE" dsdfile)
  (write-line "ConvertTextToGeometry=FALSE" dsdfile)
  (write-line "VectorResolution=1200" dsdfile)
  (write-line "RasterResolution=400" dsdfile)

  ;; Close dsd file
  (close dsdfile)

  ;; Batchplot
  (command "_.delay" 2000)
  (if files
    (progn
        (command "-PUBLISH" dsdpath)
      (princ "Publishing completed.")
    )
    (princ "No DWG files found in the specified folder.")
  )

  ;; Restore pop-ups
  (setvar "FILEDIA" OldFda)

  (princ)
)

 

0 Likes
Message 12 of 15

paullimapa
Mentor
Mentor

Script files interpret empty lines as returns. So all those empty lines in the code needs to be removed

But the first test I would run to eliminate all other variables is to use the Publish command manually drag all the dwgs in that folder you want to plot and save the dsd file. Next run the job to see if printing is successful. If yes then create a script file that just has the Publish command and the name of the dsd file you created. Then run coreconsole on this to see if you’re successful. If this fails then there’s a bug with running coreconsole and the publish command. If this doesn’t fail the next test is to use the dsd file the lisp code generated in the script with the publish command. If this fails then the lisp generates a bad dsd file. But if this succeeds then it could be all those write-line code in the lisp which coreconsole doesn’t like. But based on where you are showing the error occurs my guess would be either a badly written dsd file or there’s a problem with one of the dwgs you’re trying to publish

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 13 of 15

ec-cad
Collaborator
Collaborator

Could be a file access issue. Are the drawings copied, stacked on 'your' machine ? or on the Network.

If Network, could be the folder doesn't have you as a user that can access them. Or, read-only perhaps.

You may want to 'copy' those drawings to your temp drive, and process them there ?

One other thing to check. Are (all) those drawings saved in a Version of Acad that is = or 'lower' than the

Acad engine you're using. Just some thoughts.

ECCAD

0 Likes
Message 14 of 15

whitt0213
Contributor
Contributor

Thanks for your suggestions. I have gotten the script to work when dragging and dropping into drawing, but I'm still getting the error when trying to batch it. So, it would seem there is an issue calling -PUBLISH within the core console. Could this be because a progress bar is trying to show and core console can't handle UI? I've tested turning filedia to 0 and running the script in a drawing and the progress bar still shows. I've toggled both of those checkboxes that we talked about earlier to be checked and unchecked and the progress bar still shows. 

0 Likes
Message 15 of 15

ec-cad
Collaborator
Collaborator

Lets say you have a file "printpdf.lsp" with code above in it.

In a true script, do

(load "c:/where/printpdf.lsp") <---- change the path

(c:printpdf)

 

It's OK to add a Lisp load / call of a function from a Script file (file .scr)

Give that a whirl.

ECCAD

 

0 Likes