Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Errors Encountered in Batch Plotting with AutoLISP Script

heuiy
Participant
Participant

Errors Encountered in Batch Plotting with AutoLISP Script

heuiy
Participant
Participant

Hi everyone,

 

I've been trying to automate a batch plotting process using an AutoLISP script in AutoCAD, but I'm encountering multiple errors that I can't seem to resolve. Here's a brief description of my script and the issues:

 

Script Overview:

The script is designed to batch plot multiple areas into PDFs based on predefined coordinates. It should set the plotting parameters and execute the plotting command for each area. However, when I run the script, the commands and parameters are not recognized as expected.

 

Errors:

  1. Commands like 'Y' and 'N' for confirming plot dialog options are not recognized ("Unknown command").
  2. The plotting device and configurations like 'Model', 'ALPDF', 'Inches', 'Landscape', 'Window' are not recognized and lead to repeated prompts.
  3. File paths and output commands are not executed correctly, causing the script to fail to save the plotted PDFs.

Here are some snippets of the error messages I am receiving:

 

```

Command: Y Unknown command "Y". Press F1 for help.
Command: _.delay Enter delay time in milliseconds: 2000
Command: -PLOT Detailed plot configuration? [Yes(Y)/No(N)] <No>: N
Batch name or [?]: Model
Enter plot configuration name <>: ALPDF <ALPDF> not found.
Enter plot configuration name <>: Output device name or [?] <DWF6 ePlot.pc3>: Inches <Inches> not found.

```

 

I have attempted different configurations and checked my syntax multiple times, but the errors persist. Here's a part of the script where the issue seems to manifest:

 

```

(command "-PLOT" "N" "Model" "ALPDF" "" "Inches" "Landscape" "Y" "Window"
(strcat (rtos xMin 2 2) "," (rtos yMin 2 2))
(strcat (rtos xMax 2 2) "," (rtos yMax 2 2))
"Fit" "Center" "Y" "" "Y" "N" "N" "N" "Y"
(strcat outputPath "Output_" (itoa (1+ (setq i (1+ i)))) ".pdf")
"Y")

```

 

Could anyone help identify what might be going wrong or suggest how to correct these issues? Any advice or examples of similar scripts that work correctly would be greatly appreciated.

 

Thank you in advance for your help!

0 Likes
Reply
Accepted solutions (1)
324 Views
2 Replies
  • LSP
Replies (2)

paullimapa
Mentor
Mentor
Accepted solution

You can test the plot sequence commands on your own by entering the -PLOT (preceding the command name with a hyphen) and you'll see that when you reply No at the "Detailed plot configuration" prompt only the Page Setup prompt is requested & there are a number of questions that are no longer asked:

paullimapa_0-1712981145541.png

Now when you respond with Yes at the "Detailed plot configuration" prompt then the Page Setup prompt is no longer asked but the additional questions are asked:

paullimapa_1-1712981500053.png

So structure your script file to respond accordingly

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos

Sea-Haven
Mentor
Mentor

We had advantage of fixed title block, so the plot sequence use a detailed config like this. 

 

 

COMMAND "-PLOT"  "Y"  "" "Cutepdf Writer"
	       "A3"	"m"    "LANDSCAPE"	   "N"   "W"  "-6,-6"    "807,560"	"1=2"  "C"
	       "y"	  "Designlasercolour.ctb" "Y"	"n"    "n"    "y"   "N" "N" "y"      )
    )

 

 

You need to edit it to suit your title block this is for an A1 sheet but plotted as a A3 then its buried inside a layout loop so all layouts are plotted. Can do this inside a script. Another pre lisp I have is move all layouts to 0,0 this stops title blocks that have been moved not plotting correctly.

 

Ok version 2 accepts layouts with different title blocks still automatically plotted think Landscape & Portrait.

 

This may help not a solution.