John Scheffel
04-03-2003, 03:17 PM
As part of a recent project, I wrote a macro which will plot all the sheets in an Annotation drawing which has been loaded into Drafting 11.6. Since it relates to an enhancement request (http://www.cocreateusers.org/forum/showthread.php?s=&threadid=2347) that I submitted, I am posting it here in case it will benefit others.
Note that it you have Drafting set to open Print Manager, it will only open it once so you don't get prompted for each sheet. If it is set to not open Print Manager, everything will go to the default printer with the default settings.
DEFINE Plot_all_sheets
LOCAL Cur_sheet
LOCAL Row
LOCAL Save_nt_print_mgr_option
{Save the current Print Mgr Option}
LET Save_nt_print_mgr_option Nt_print_mgr_option
{Check if current drawing is from Annotation}
INQ_ENV 0
IF (POS (INQ 305) 'Annotation' )
{If from Annotation, plot all sheets}
Show_sheets
LET Row 1
LOOP
LET Cur_sheet (READ_LTAB 'List_of_sheets' Row 1)
EXIT_IF (Cur_sheet = '')
EDIT_PART TOP
VIEW Cur_sheet
EDIT_PART Cur_sheet
Plot_current_sheet
LET Row (Row+1)
Print_mgr_option_off
END_LOOP
ELSE
{Not annotation drawing, just plot drawing with current settings}
Plot_start
END_IF
IF (Save_nt_print_mgr_option)
Print_mgr_option_on
END_IF
END_DEFINE
Note: Edited by John Scheffel on 4/25/2003 to use the new Plot_current_sheet macro intead of setting the source to CURRENT_WINDOW.
Note that it you have Drafting set to open Print Manager, it will only open it once so you don't get prompted for each sheet. If it is set to not open Print Manager, everything will go to the default printer with the default settings.
DEFINE Plot_all_sheets
LOCAL Cur_sheet
LOCAL Row
LOCAL Save_nt_print_mgr_option
{Save the current Print Mgr Option}
LET Save_nt_print_mgr_option Nt_print_mgr_option
{Check if current drawing is from Annotation}
INQ_ENV 0
IF (POS (INQ 305) 'Annotation' )
{If from Annotation, plot all sheets}
Show_sheets
LET Row 1
LOOP
LET Cur_sheet (READ_LTAB 'List_of_sheets' Row 1)
EXIT_IF (Cur_sheet = '')
EDIT_PART TOP
VIEW Cur_sheet
EDIT_PART Cur_sheet
Plot_current_sheet
LET Row (Row+1)
Print_mgr_option_off
END_LOOP
ELSE
{Not annotation drawing, just plot drawing with current settings}
Plot_start
END_IF
IF (Save_nt_print_mgr_option)
Print_mgr_option_on
END_IF
END_DEFINE
Note: Edited by John Scheffel on 4/25/2003 to use the new Plot_current_sheet macro intead of setting the source to CURRENT_WINDOW.