Different behavior with same scr code between accoreconsole.exe and AutoCad GUI command with a specific dwg file

Different behavior with same scr code between accoreconsole.exe and AutoCad GUI command with a specific dwg file

吃百
Explorer Explorer
1,265 Views
10 Replies
Message 1 of 11

Different behavior with same scr code between accoreconsole.exe and AutoCad GUI command with a specific dwg file

吃百
Explorer
Explorer

I'm trying to print a png with script below(save as cad2png.scr):

-PLOT
Y
Model
PublishToWeb PNG.pc3

P
N
W
-1326.42,-1250.0
46615.8,20025.57
F
C
N
.
N
V
R
"testVR.png"
Q
N
N
Y

 

1. If I type the code one by one in AutoCad GUI command, it works perfect

test-Model.png

 

 

But if I use command as accoreconsole /i test.dwg /s cad2png.scr

The result is empty white image

testVR.png

 

The test dwg is below:

 

0 Likes
1,266 Views
10 Replies
Replies (10)
Message 2 of 11

cadffm
Consultant
Consultant

Hi,

 

I can't say what is corrupt, but there is.. (to much data I have to compare to find the real issue, no time for it)

(I saw a hint to EZDXF and this can be the source issue - the EZDXF library is to write DXF, but it isn't from AutoDESK)

 

The Problem is not in your Script or grapgical objects, it is the modelspace &modelspace-Layoutdata

Copy to a new file is a workaround, but for batchjobs you need to find a way to "Check" file  about this problem, hmm.

 

 

Sebastian

0 Likes
Message 3 of 11

Sea-Haven
Mentor
Mentor

Is this not what publish will help with ?

 

The plot part can be a lisp file, your script would (load "myplot") or just do the lisp code in the script. See if that makes any difference.

 

2nd stab in dark add (setvar 'ctab "Model") as 1st line

0 Likes
Message 4 of 11

吃百
Explorer
Explorer

Thank you for your answering!

But I'm tring to do it in a command batch rather involved in another coding language

0 Likes
Message 5 of 11

吃百
Explorer
Explorer

Thank you for your ansering!
# Enter shade plot setting [As displayed/legacy Wireframe/legacy Hidden/Visualstyles/Rendered] <As displayed>
A
Another hint is if I pick shade plot setting as A(As displayed), the data in scr batch will print correctly.
Now I create a simple.dwg as problem repetition, the content is only a rectangle as polygon.

0 Likes
Message 6 of 11

cadffm
Consultant
Consultant

Sea-Haven

command statement in script or in lisp file or the commands without lisp directly in Lisp doesn't matter (in this case)

>>"2nd stab in dark add (setvar 'ctab "Model") as 1st line"

The file is saved in model, the plot command input is set up to plot the model tab,

it doesn't matter.

 

@吃百 

I saw inconsistencies about materials data, your observation fits quite well!
VisualStyle-Realistic takes materials into account and if there is a problem, then the output is also crazy (it's a miracle that the empty PDF is created at all)

 

>>"the content is only a rectangle as polygon."

Nothing to do with your graphical objects.

 

 

Sebastian

0 Likes
Message 7 of 11

revit.bmz
Contributor
Contributor

p

0 Likes
Message 8 of 11

cadffm
Consultant
Consultant

Hi 

is that answer to me or to the TO?

 

If to me:

1.Why should I do that? I didn't yet.

2.it looks wrong (one missing enter = linebreak or space)

 

Sorry, i didn't understand your reply

Sebastian

0 Likes
Message 9 of 11

吃百
Explorer
Explorer
But if type the code into AutoCAD GUI command, it works well no matter how inconsistent the materials are.
I think there must be different procedure to run the scr code between AutoCAD GUI command and accoreconsole.exe!!
0 Likes
Message 10 of 11

Kent1Cooper
Consultant
Consultant

Just a guess, but sometimes things like file or Block or Layer names with spaces in them cause trouble.  Does it work if you enclose the one such line in quotation marks?

"PublishToWeb PNG.pc3"

Kent Cooper, AIA
0 Likes
Message 11 of 11

cadffm
Consultant
Consultant

The Script is okay (the plot command itself is the same in acc and acad.exe.

The problem is file dependend (but I didn't figured out what the problem is. I hadn't enough time for it)

 

 

@吃百 

>>"I think there must be different procedure to run the scr code between AutoCAD GUI command and accoreconsole.exe"

 

Yes, there are a lot of differences between!

But I don't know all cases of

- you can not do and others where

- you have to load additional stuff

 

I am in holiday and pretty sure I won't take time for it the next 3-4 weeks.

 

Greetings from Italia!

Sebastian

0 Likes