Author Topic: problem with plot  (Read 2157 times)

0 Members and 1 Guest are viewing this topic.

haibinpro

  • Newt
  • Posts: 52
problem with plot
« on: July 29, 2015, 09:02:58 PM »
my environment is win xp,autocad 2004 se

I write a lsp script to plot dwg file quickly.
i make some change to make it can easy read.(as my cad is simple chinese,I ref something to change it to english)
the code is like this.
Code: [Select]
(command

    "_.-plot"

    "_Y" ;; Detailed plot configuration? [Yes/No]:

    ""   ;; Enter a layout name <Current-Layout>:

    "Adobe PDF" ;; Enter an output device name:

    "A4" ;; Enter paper size:

    "_I" ;; Enter paper units [Inches/Millimeters]:

    "_L" ;; Enter drawing orientation [Portrait/Landscape]:

    "_N" ;; Plot upside down? [Yes/No]:

    "_E" ;; Enter plot area [Display/Extents/Limits/View/Window]:

    "_F" ;; Enter plot scale (Plotted Inches=Drawing Units) or [Fit] <1=1>:

    "_C" ;; Enter plot offset (x,y) or [Center]:

    "_Y" ;; Plot with plot styles? [Yes/No]:

    "acad.ctb" ;; Enter plot style table name (enter . for none):

    "_Y" ;; Plot with lineweights? [Yes/No]:

    "_N" ;; Scale lineweights with plot scale? [Yes/No]:

    "_N" ;; Plot paper space first? [Yes/No]:

    "_N" ;; Hide paperspace objects? [Yes/No]:
   
    "_N"
   
    "_N" ;; Save changes to page setup [Yes/No]:

    "_Y" ;; Proceed with plot [Yes/No]:

)

the code is ref to this
http://www.theswamp.org/index.php?topic=46869.msg519002#msg519002

use this script
print error.dwg will print with  error occur(something like unknown command)
while print is ok.dwg will  print ok.

I have check the cad help.
it said:if the dwg is print by layout it will use the option: Plot paper space first?
while print by model,it will use other option.

I have no idea how to know if i use this plot script ,it (the dwg i try to print )will print by layout or by model
the two dwg file's tilemode are allways 1.
if i know it,I can make different script for this.

any help

attachment file plot.zip
comtain 3 files:
print error.dwg
print is ok.dwg
plot.lsp
_F
« Last Edit: July 29, 2015, 09:08:51 PM by haibinpro »

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: problem with plot
« Reply #1 on: July 30, 2015, 03:15:43 AM »
You say that for both drawings the tilemode is 1. That means that in both cases the Model tab is plotted. This also means that your Lisp must fail in both cases, since the code can only work for paper space layouts.

haibinpro

  • Newt
  • Posts: 52
Re: problem with plot
« Reply #2 on: July 30, 2015, 08:36:36 PM »
You say that for both drawings the tilemode is 1. That means that in both cases the Model tab is plotted. This also means that your Lisp must fail in both cases, since the code can only work for paper space layouts.
Although the two drawings  the tilemode is 1.and the two drawings model tab activate too.but if i print it by command line。
one drawing will plot in layout mode,and the orther will plot in model mode.
Just try.

I have no idea how this happen.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: problem with plot
« Reply #3 on: July 31, 2015, 05:10:48 AM »
Run the AUDIT command on 'print is ok.dwg'. The 'ok' dwg is NOT 'ok' :-D.
Code: [Select]
: AUDIT
Fix any errors detected? Yes/<No>: y

Name: AcDbLayout(22)
Value: Layout has invalid ModelType flag
Validation: Invalid
Replaced by: Set to True

haibinpro

  • Newt
  • Posts: 52
Re: problem with plot
« Reply #4 on: August 03, 2015, 02:42:40 AM »
yes,audit can find some err and fix it.
but the plot behaviour is the same before and after(use audit command)

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: problem with plot
« Reply #5 on: August 03, 2015, 04:38:09 AM »
I use BricsCAD.
After running the AUDIT command to fix the problem, the -PLOT command shows the normal prompts for the "Model" tab. Of course your code will fail as it can only work for PS layouts.
If AutoCAD cannot fix this with AUDIT you can perhaps try the RECOVER command.
Code: [Select]
: AUDIT
Fix any errors detected? Yes/<No>: y

Name: AcDbLayout(22)
Value: Layout has invalid ModelType flag
Validation: Invalid
Replaced by: Set to True

134 objects audited
Total errors found during audit 1, fixed 1
: -PLOT
Detailed plot configuration? Yes/<No>/Extended: y
Enter a layout name or [?] <Model>:
Enter an output device name or [?] <default.pc3>:
Enter paper size or [?] <Letter 8 1/2 x 11 in>:
Enter paper units Inches/<Millimeters>:
Enter drawing orientation Portrait/<Landscape>:
Plot upside down? Yes/<No>:
Enter plot area <Display>/Extents/Limits/View/Window:
Enter plot scale (Plotted millimeters = Drawing Units) or Fit <1:1>:
Enter plot offset (x,y) or Center <0,0>:
Plot with plot styles? Yes/<No>:
Enter plot style table name or [?] (enter . for none) <>:
Plot with lineweights? Yes/<No>:
Remove hidden lines? Yes/<No>:
Write the plot to a file? Yes/<No>: n
Save changes to layout? Yes/<No>: n
Proceed with plot? <Yes>/No: n

haibinpro

  • Newt
  • Posts: 52
Re: problem with plot
« Reply #6 on: August 03, 2015, 05:16:18 AM »
after use command audit at the file "print is ok.dwg".It fix all the error,and then use command recover will find none error tobe fix.

thanks roy_043
I known you show me the reason why the dwg files plot in a strange way.
I'll try fix the error and use the plot script at a higher version of autocad to see if the problem canbe solve and report it here.

if anyone known the other way how to plot the two files with normal behaviour.Pls let me known. thanks.