Jump to content

Plotting to a file using Script


daveyboyd

Recommended Posts

Ok, so I have a basic script file that plots a drawing using the set prarmeters given but I am getting stuck at the end where I have to give it a file name as it is a PDF plot, a dialog box opens and then nothing. I have attached the file. What I really need is a program which gives the drawing name as the file name. Does this make sense? If so any ideas? I have output a bunch of drawings to PDF for an entire project and the only other option is to do each one individually (100+ drawings!). Please, for my insanity, help!

 

Dave

plot.scr

Link to comment
Share on other sites

I don't have scriptpro so can't suggest how it can be used.

 

Try setting FILEDIA to 0 before running the script.

 

(No guarantees to what will happen)

 

And don't forget to set FILEDIA to 1 afterwards :D

Link to comment
Share on other sites

if this helps this is what i have for my script to plot to pdf and it shows the plot configuration questions. Yours will obviously be different but this may give you a start. just follow along with the command prompts by using -plot

;Here are the questions you need to answer if you were going to automate plotting via script file at the command line in 2006:

;Command: -plot

;Detailed plot configuration? [Yes/No] :y

;Enter a layout name or [?] : Layout1

;Regenerating model - caching viewports.

;Enter an output device name or [?] : Adobe PDF

;Enter paper size or [?] :

;Enter paper units [inches/Millimeters] :

;Enter drawing orientation [Portrait/Landscape] :

;Plot upside down? [Yes/No] :

;Enter plot area [Display/Extents/Layout/View/Window] :

;Enter plot scale (Plotted Inches=Drawing Units) or [Fit] :

;Enter plot offset (x,y) :

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

;Enter plot style table name or [?] (enter . for none) :

;Plot with lineweights? [Yes/No] :

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

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

;Hide paperspace objects? [Yes/No] :

;Write the plot to a file [Yes/No] :

;Save changes to page setup [Yes/No]?

;Proceed with plot [Yes/No] :

;Plot to previous setting

-plot

y

Model

\\kingston\Xerox5225

11x17

Inches

Landscape

No

Extents

Fit

Center

Yes

LJ5000-D-ONEWEIGHT.ctb

Yes

No

No

No

Yes

;Save and close drawing

save

Yes

Yes

Close

Link to comment
Share on other sites

Could you use a string that specifies the directory? Probably would only work if you had sequentially numbered drawings? I used this for an excel thing awhile back.

 

Create a visual basic file with the string, etc. and have it call the script. Let the script end at the point where you would be entering the filename, and then have another script that runs afterwards to complete the process. Just throwing out ideas, not sure how practical they are, depends on filenames.

 

Const sPath As String = "C:\username\Example_Folder\"

Dim cell As Range

Dim sName As String

Dim oCmt As Comment

 

sName = sPath & .Value & ".jpg"

 

*********************************

****.Value= the cell contents in excel****

Link to comment
Share on other sites

if this helps this is what i have for my script to plot to pdf and it shows the plot configuration questions. Yours will obviously be different but this may give you a start. just follow along with the command prompts by using -plot

;Here are the questions you need to answer if you were going to automate plotting via script file at the command line in 2006:

;Command: -plot

;Detailed plot configuration? [Yes/No] :y

;Enter a layout name or [?] : Layout1

;Regenerating model - caching viewports.

;Enter an output device name or [?] : Adobe PDF

;Enter paper size or [?] :

;Enter paper units [inches/Millimeters] :

;Enter drawing orientation [Portrait/Landscape] :

;Plot upside down? [Yes/No] :

;Enter plot area [Display/Extents/Layout/View/Window] :

;Enter plot scale (Plotted Inches=Drawing Units) or [Fit] :

;Enter plot offset (x,y) :

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

;Enter plot style table name or [?] (enter . for none) :

;Plot with lineweights? [Yes/No] :

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

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

;Hide paperspace objects? [Yes/No] :

;Write the plot to a file [Yes/No] :

;Save changes to page setup [Yes/No]?

;Proceed with plot [Yes/No] :

;Plot to previous setting

-plot

y

Model

\\kingston\Xerox5225

11x17

Inches

Landscape

No

Extents

Fit

Center

Yes

LJ5000-D-ONEWEIGHT.ctb

Yes

No

No

No

Yes

;Save and close drawing

save

Yes

Yes

Close

 

I treid this but it gets to the same point as me where a dialog box opens asking for a file name, I want to just accept the default name for the drawing and carry on . . .?

Link to comment
Share on other sites

I treid this but it gets to the same point as me where a dialog box opens asking for a file name, I want to just accept the default name for the drawing and carry on . . .?
have you tried my suggestion yet?
Link to comment
Share on other sites

I treid this but it gets to the same point as me where a dialog box opens asking for a file name, I want to just accept the default name for the drawing and carry on . . .?

What if you changed it to qsave at the end of the script instead of save?

Link to comment
Share on other sites

have you tried my suggestion yet?

 

Nah, it stalls on the same dialog box, thanks.

 

Much the same for the other suggestion, the problem is writing it to a file, its stalling before the save bit

Link to comment
Share on other sites

Nah, it stalls on the same dialog box, thanks.

 

Much the same for the other suggestion, the problem is writing it to a file, its stalling before the save bit

it shouldn't do. It turns off the file dialogue box and resorts to the command line. My scripts continue with a space to represent the default file name. Done this MANY times. Maybe ADT overrides something that vanilla acad doesn't.

 

try CMDDIA = 0 as well just in case its not the file dialogue box thats being shown.

Link to comment
Share on other sites

Here is a typical script of mine. I use the AutoCAD converter (as you can see) and I supply the output file name (which is why I used to use excel) but a space there has worked in the past.

SDI
1
open
"h:\Design_Office\20008402_1.dwg"
plot
y
Model
DWG to PDF.pc3
ISO A3 (420.00 x 297.00 MM)
m
l
n
e
F
C
y
STL Mono.ctb
y
AS
h:\Design_Office\20008402_1.dwg.PDF
n
y
qnew
Y

 

or for paperspace

 

SDI
1
open
"h:\Design_Office\20008402_1.dwg"
plot
y
Layout1
DWG to PDF.pc3
ISO A3 (420.00 x 297.00 MM)
m
l
n
e
F
C
y
STL Mono.ctb
y
n
n
n
"h:\Design_Office\20008402_1.dwg.PDF"
n
y
qnew
Y

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...