PDA

View Full Version : Tip: Right Click Print in Drafting 11.6


John Scheffel
11-01-2002, 02:38 PM
I'm not sure if this was introduced in 11.0 or 11.6, but this is a new feature I think many people will like. Under Windows you can right click on one or more *.mi files in Explorer, select Print, and send to a printer. You can now print wihout opening Drafting and loading a file. It's sort of MEPLOT for Windows and can be handy for batch printing.

The standard install will send A4 size to the default printer. If you want to change the behavior you can right click on any *.mi file and select Edit Print Config. This will open the customize_p.m file (located under the main Drafting folder) into NotePad. This file will be INPUT whenever you right click Print and can be used to customize the print process. However, the default file has very little information about how to customize printing. I contacted CoCreate support and here is some info they provided on customizing the Print function.

To view information on what to put in this file, open the appendix.htm file under the main Drafting folder. Look for the heading "Plotting multiple drawings on Windows". This provides some commands that you can place in this file to customize printing. If you want ANSI A size (Letter) instead of A4, you need to add a line similar to:
WIN_PRT_MGR PAPER 'Letter' ORIENTATION LANDSCAPE COPIES 1 END
Note the the size must exactly match the name of one of the available sizes for your default print driver. Most have a Letter size so this should work.

I have attached a text file which I think is a better template for the customize_p.m file. It contains a lot of comments and examples of commands that you can use to customize the behavior of right click print.

ME102007
04-17-2009, 12:22 AM
My customize_p.m file added part:

PLOTTER_TYPE 'PDF_GENERIC'
WIN_PRT_MGR PAPER 'A3' ORIENTATION LANDSCAPE COPIES 1 END
PLOT_DESTINATION DEL_OLD 'filename.pdf'

How to make the result pdf file with the same name as the MI file?

John Scheffel
04-17-2009, 08:58 AM
You can get the full path file name of the currently loaded file using INQ_ENV with INQ 304.
INQ_ENV 0
LET Current_filename (INQ 304)
If you want just the file name without the path it gets a little trickier. Here is a macro that I wrote some time ago which should work. This macro sets the variable Basename to the file name without the path
DEFINE Get_basename
LOCAL Current_fullpath
LOCAL Slash_posn
LOCAL Substring
LOCAL Path_sep
LOCAL Strlen
INQ_ENV 0
LET Current_fullpath (INQ 304)
{ The direction of the slash can vary depending on how file was loaded }
{ Set the path separator based on which is found in the string. }
IF (POS Current_fullpath '\')
LET Path_sep '\'
ELSE
LET Path_sep '/'
END_IF

{Extract the base name from the full path}
LET Slash_posn (POS Current_fullpath Path_sep)
LET Substring Current_fullpath
LET Strlen (LEN Substring)
LOOP
IF (Slash_posn<>0)
LET Substring (SUBSTR Substring (Slash_posn + 1) (Strlen - 1))
LET Strlen (LEN Substring)
LET Slash_posn (POS Substring Path_sep)
LET Basename Substring
ELSE
LET Basename Substring
END_IF
EXIT_IF (Slash_posn=0)
END_LOOP
END_DEFINE {Get_basename}

ME102007
04-17-2009, 04:50 PM
Thank you John!I will try it.

Peter Boks
04-20-2009, 01:02 AM
I have posted a macro at the end of this (http://www.cocreateusers.org/forum/showthread.php?t=6951) topic that can help you with the creation of pdf files.
With the use of John's macro, you can modify it to create a "current_filename.pdf"