AutoCAD LT General Discussion

AutoCAD LT General Discussion

Reply
Active Member
mcconley
Posts: 8
Registered: ‎03-28-2012
Message 1 of 4 (542 Views)

Command Line -plot scale error or problem.

542 Views, 3 Replies
02-08-2013 02:48 PM

Hi, 

 

I could really use some help here as I cannot quite understand why AutoCAD 2011 LT is behaving this way. This post applies to plotting using the command line for batch plotting purposes.

 

So I have written a program that outputs an AutoCAD script that prints numerous drawings quickly. The script file obviously uses the AutoCAD’s command line as its input interface. Where I have run into problems is actually printing the file to the correct scale.

 

Anyone that is familiar with the command line interface in AutoCAD knows that most of the time when a command is issued and the user is prompted for input, AutoCAD also presents a <default option> at the end of the prompt that can be selected by using a hard return or simply giving no input. This default option is what I rely on for my batch processing as each drawing has slightly different plotting options such as paper size and scale. I have had much trouble with the following prompt;

 

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

 

This prompt can be found by using the following 4 line script;

 

-plot Y Model

Adobe PDF

Letter

Inches Landscape N E

 

The error or problem that I am experiencing is that when the default <1=1> scale is used it does not actually plot at this scale. However if the default is <1=1> and 1=1 is provided as user input the correct scale plots. 

 

In the following example the prompt will be left blank or responded to as shown and the resulting plot.log entry is presented.

 

(Prompt and response) Enter plot scale (Plotted Inches=Drawing Units) or [Fit] <1=1>:

(Plot.log entry)  P:\......\Componant_Xsection.dwg,Model,2/8/2013 3:30:43 PM,Adobe PDF,Letter,1:0.934093,

 

(Prompt and response) Enter plot scale (Plotted Inches=Drawing Units) or [Fit] <1=1>:1=1

(Plot.log entry)  P:\......\Componant_Xsection.dwg,Model,2/8/2013 3:29:47 PM,Adobe PDF,Letter,1:1,

 

As you can see by using the default the actual scale printed is incorrect at a 1:0.934093, but if you manually enter the scale 1=1 then it is plotted at the correct 1:1 scale

 

Please if anyone could help me that would be much appreciated. 

 

 

*Expert Elite*
pendean
Posts: 23,349
Registered: ‎11-06-2003
Message 2 of 4 (539 Views)

Re: Command Line -plot scale error or problem.

02-08-2013 03:07 PM in reply to: mcconley

IMHO as a long time code writer, if you want 1:1 you should always code it to be 1:1, and never "default".

How do you know the default is truly 1-1 and not 1=0.934093? Rounding display errors are very common in AutoCAD.

Is 0.93493 always the problem, or is this only observed in one file?

 

Perhaps two choices for a user, one to put in what they need, and one that defaults to 1:1 automatically (no user options): a better approach. Remember, if your going to ask your user to make more than one entry/selection it's best to simply call the PLOT command pop-up for them to use.

 

Worth a test though: when your -PLOT is complete, save the changes to the pagesetup but cancel going through the plot process. Then call the PLOT command pop-up: anything different or wrong that needs to be fixed?

Dean Saadallah Blog | Facebook | Google+ | Twitter | PINS
Active Member
mcconley
Posts: 8
Registered: ‎03-28-2012
Message 3 of 4 (532 Views)

Re: Command Line -plot scale error or problem.

02-08-2013 03:41 PM in reply to: pendean

Thank you for your response pendean,

 

It has been helpful in further determining the root cause of the inaccurate scales being printed. I believe that instead of the default shown in the prompt <1=1>, the actual default in the AutoCAD code reads <Fit>. Someone has probably just miscoded a switch in the program. 

 

I tried the test / comment in the last paragraph of your reply and indeed after saving the settings after the -plot command the GUI prompts shows the Fit to paper option checked under Plot Scale.

 

The reason I know that the plot setting is 1:1 or whatever the drawing is set to be is when using the PLOT GUI pop up dialog box the correct default scales are presented for the drawings. Simply using all the defaults for the GUI box plots the drawing at the correct scale.

 

The reason that I simply do not just specify the scale is because the purpose of this exercise is automation. If one has to evaluate and input a scale for hundreds of drawings instead of the program using the scale that has been previously defined by the drafter, it kind of defeats the point of batch plotting.

 

This one looks like it is chalked up to a bug in AutoCADs code.

*Expert Elite*
pendean
Posts: 23,349
Registered: ‎11-06-2003
Message 4 of 4 (512 Views)

Re: Command Line -plot scale error or problem.

02-11-2013 04:57 AM in reply to: mcconley

<fit> is not <1:1>: it would appear your users would benefit from having more than one macro to use. Automation only works if it's what your users want, not what you can only program.

 

You might benefit from incorporating predefined pagesetups from your templates using -PSETUPIN command for your users: but again, think of their needs and wants (and their behaviors) when automating.

Dean Saadallah Blog | Facebook | Google+ | Twitter | PINS
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!