Scripting help

Scripting help

sbuddNGV76
Observer Observer
120 Views
5 Replies
Message 1 of 6

Scripting help

sbuddNGV76
Observer
Observer

I'm in a unique situation where I need to open drawings and print them as .png files. however I'm running into an issue with my script. Autocad opens each individual file however is only printing the very last one multiple times with different file names. I feel like trying to find the commands to use for this has been an absolute nightmare. Any idea's on how I can achieve this? 

"Zoom"
"Extents"
"._plot"
"Yes"
"Model"
"PublishToWeb PNG.pc3"
"VGA (640.00 x 480.00 Pixels)"
"Portrait"
"No"
"Extents"
"Fit"
"0.00,10.00"
"Yes"
"."
"No"
""
"""Serverlocation" & strRecordNumber & ".PNG"""
"No"
"Yes"
"_QUIT"
"Yes"

0 Likes
121 Views
5 Replies
Replies (5)
Message 2 of 6

paullimapa
Mentor
Mentor

The issue is in this line of your script

"""Serverlocation" & strRecordNumber & ".PNG"""

You’ll need to include the drawing name to make each png filename unique 

Can you also clarify what defines the variables Serverlocation and strRecordNumber?

Also the & used here is for what purpose?


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

sbuddNGV76
Observer
Observer

hi paullimapa, 

This is the location that once you click print it asks for where to save, this is old VB6 program I'm working with  so i'm telling it the UNC  , appending the filename and .png to the string.  This does output files to this location, and the filename does change however DWGtv is only outputting 1 file over and over again.  so for instance i'll have 6 files called different things but only have 1 drawing. I am watching DWGtv open multiple files as well. 

0 Likes
Message 4 of 6

paullimapa
Mentor
Mentor

Has this vb6 program ever worked before?

If not, then there's probably something wrong with that part of the code because the AutoCAD commands look correct other than that one line I mentioned in my previous reply.

Also I'm not sure what you mean by "DWGtv". 


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

sbuddNGV76
Observer
Observer

This worked when we used Autocad LT,  DWGtv- DWG Trueview looks like it can do the same thing, syntax has definitely changed.  It doesn't appear you can launch TrueView without calling on a file when using the /b command. The only time I succesfully launch a script is when i call on an existing drawing   as in   " \\filepath\250.dwg /b script.scr " Are you aware of any other way to launch the application and have it run a script without telling it which file to directly open? 

0 Likes
Message 6 of 6

paullimapa
Mentor
Mentor

I'm not aware of an option to launch a script file with Dwg Trueview without specifying a drawing file.

You may want to post this request in the Dwg Trueview forum:

DWG TrueView Forum - Autodesk Community


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