187lockdown,
This grip was originally written to swap out old formats with new ones... I think it should work in your case if you change the drawing sizes of each sheet before running the grip. Of course, you'll have to edit somethings in the routine (directory path for separate part files representing a 'std lib' in the native environment, as well as part name and revision to be used in the Tce environment of the patterns, etc...) before compiling it, but this should get you pretty close...
This routine calls the new patterns based on the dwg sheet size, the width specicically....
Hope this helps...
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ $$
$$ Program Name: format-swap-w2k.grs *W2K* $$
$$ $$
$$ Author: Mike Thompson $$
$$ $$
$$ $$
$$ Release Date: 09-Aug-2005 $$
$$ $$
$$ Abstract: This program replaces the existing format patterns$$
$$ and proprietary notices, regardless of dwg size. $$
$$ This routine is dependant upon Teamcenter for the $$
$$ patterns. $$
$$ $$
$$ Required sub-routines: None $$
$$ $$
$$ Assumptions: The revision of Team Center parts WILL NOT change,$$
$$ because at this time the routine will NOT auto- $$
$$ matically pick up the latest revisions...only the $$
$$ revision "hard-coded" into the routine is used. $$
$$ $$
$$ The drawings are to current standards or practices$$
$$ Revisions: $$
$$ $$
$$ By Date Description $$
$$ --- ----------- ---------------------------------------- $$
$$ MWT10-02-2005 Corrected for condition if INFO sht $$
$$ when starting grip routine $$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ section - a: declare and initialize variables $$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
GRIPSW/ DECLRV $$ Force declare all variables
NUMBER/ w, $ $$ Drawing width size /INCHES
xc,dxc,xp,$
yc,dyc,yp,$
sv_wlayer,$ $$ Original work layer
drwcnt,$ $$ Variable to increment dwgs
num,$ $$ number of dwg shts to add
M(12),$ $$ General Matrix > Matrix Name
P(12),$ $$ Decal Matrix > Matrix Name
x
STRING/ shname(102,30),$ $$ array for dwg names
sheetn(102),$ $$ sheet numbers
filename(132),$
logo(132),$
pnm(32),lnm(32),snm(32),znm(32),$ $$ std part name
prv(13),lrv(32),srv(32),zrv(32),$ $$ std part rev
tmsg(40),$ $$ # dwg shts text message
trp(40),$ $$ # dwg shts variable response
nxtsht(102),$ $$ next sht name
INFO(4),SH1(4),$
PATH (100),$
PATH2(100),$
dwgnm(10),$ $$ Name of new dwg sheet
sh(4),$
dwgsht(3) $$ sheet number
ENTITY/ ptext,d17,hslogo $$ Name of decals to import
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ section - b: check for active part & dwg sht present $$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
IF/ &ACTPRT ==0,$ $$IF part NOT active
PRINT/ 'You must have a part file open.',$
'Open a part file and try again.',$
'Terminating progam.'
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ section - c: initialize & declare variables $$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
x=0
yc=0
w =0 $$ dwg sht width
PATH2 = '/datm/stdlib/draw/' $$ Unix Path
PATH = 'k:\datm\stdlib\draw\' $$ W2K Path
INFO = 'INFO'
SH1 = 'SH1'
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ section - d: How many new dwg sheets desired? $$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
PRINT/'*** REPLACING ALL FORMATS FOR DWG SHEETS ***'
PRINT/' ...please be patient.'
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ section - e: cycle db, count number of dwg shts $$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
INEXTN/62 $$ 62=Drawings only
DRWC0: drwcnt=0
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ section - f: delete all formats $$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
&WLAYER = 249
MASK/ 10 $$ patterns only
DELETE/ALL
PRINT/ 'All formats deleted...'
$$ Deletes appropriately named proprietary info blocks from dwg's
IF/ drwcnt==0
d2: DELETE/&ENAME(1,'decals-17',IFERR, DRWC1

PRINT/' deleting ''decals-17'' group from file...'
JUMP/d2:
$$ Set to info sheet, x incrementer to determine proper format NOT
$$ based on drwcnt
DRWC1: IFTHEN/ &CURDRW<>INFO
drwcnt=drwcnt+1
x=x+1
ENDIF
IFTHEN/ &CURDRW==INFO AND drwcnt==0
drwcnt=1
ENDIF
shname(drwcnt)=&CURDRW
&CURDRW=shname(drwcnt)
sheetn=shname(drwcnt)
shname(drwcnt)=NEXTN/IFEND,ERR020:
&CURDRW=shname(drwcnt)
IF/ &CURDRW==INFO,JUMP/DRWC1: $$ Omits INFO sht
DRWC2:
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ section - g: cycle db, Verify dwg sht size $$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
DRAWV/,,,,,w,IFERR,ERR030: $$ Determines dwg sheet width
PRINT/shname(drwcnt)+' Width is ' + ISTR(w)
$$ Determine dwg sheet size
DWGSZ:
$$ D size
IFTHEN/ w==34
xc=-11
yc=0
xp=0
yp=-12
dxc=34 $$ New dwg width
dyc=22 $$ New dwg height
$$ IMAN Pattern file and Rev to retrieve
pnm='PATTERN-D-CONT'
prv='A'
snm='PATTERN-D'
srv='B'
lnm='PATTERN-LOGO-XX'
lrv='-'
$$ E size
ELSEIF/ w==44
xc=0
yc=0
xp=0
yp=0
dxc=44 $$ New dwg width
dyc=34 $$ New dwg height
$$ IMAN Pattern file and Rev to retrieve
pnm='PATTERN-E-CONT'
prv='A'
snm='PATTERN-E'
srv='B'
lnm='PATTERN-LOGO-XX'
lrv='-'
$$ J55 size
ELSEIF/ w==55
xc=11
yc=0
xp=0
yp=0
dxc=55 $$ New dwg width
dyc=34 $$ New dwg height
$$ IMAN Pattern file and Rev to retrieve
pnm='PATTERN-J55-CONT'
prv='000'
snm='XX-PTRN-J55'
srv='D'
lnm='PATTERN-LOGO-XX'
lrv='-'
$$ J66 size
ELSEIF/ w==66
xc=22
yc=0
xp=0
yp=0
dxc=66 $$ New dwg width
dyc=34 $$ New dwg height
$$ IMAN Pattern file and Rev to retrieve
pnm='PATTERN-J66-CONT'
prv='B'
snm='PATTERN-J66'
srv='C'
lnm='PATTERN-LOGO-XX'
lrv='-'
$$ J88 size
ELSEIF/ w==88
xc=44
yc=0
xp=0
yp=0
dxc=88 $$ New dwg width
dyc=34 $$ New dwg height
$$ IMAN Pattern file and Rev to retrieve
pnm='PATTERN-J88-CONT'
prv='B'
snm='PATTERN-J88'
srv='C'
lnm='PATTERN-LOGO-XX'
lrv='-'
$$ J110 size
ELSEIF/ w==110
xc=66
yc=0
xp=0
yp=0
dxc=110 $$ New dwg width
dyc=34 $$ New dwg height
$$ IMAN Pattern file and Rev to retrieve
pnm='PATTERN-J110-CONT'
prv='B'
snm='PATTERN-J110'
srv='C'
lnm='PATTERN-LOGO-XX'
lrv='-'
ELSE
PRINT/ ' Invalid dwg sheet size..',$
' This routine WILL NOT work...'
$$ JUMP/DRWC1:
ENDIF
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ section - h: Add formats updated format
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
&WLAYER = 249
MASK/ 10 $$ patterns only
P = MATRIX/TRANSL,xp,yp,0 $$ Decal Matrix
M = MATRIX/TRANSL,xc,yc,0
$$ Pattern
IFTHEN/ x==1 and drwcnt==1
filename = UGMGRE/PRTNUM,snm,PRTREV,srv
PATRET/filename $$ Dwg format, IMAN
logo = UGMGRE/PRTNUM,lnm,PRTREV,lrv
PATRET/logo,M
PRINT/' Format and logo added, sht 1'
ELSE
filename = UGMGRE/PRTNUM,pnm,PRTREV,prv
PATRET/filename
PRINT/ ' Format added to continuation sheet...'
$$ Add Proprietary Decal Block
d17=RPATTG/PATH+'decals-17.prt',$
P,LAYER,NOVIEW,IFERR,ERR020:
PRINT/ ' PROPRIETARY RIGHTS decal added...'
ENDIF
LAYER/WORK,250,REF,249
JUMP/DRWC1:
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ section - j: ERRORS:
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
ERR010: PRINT/ ' Error importing pattern...terminating program.'
JUMP/ CANCEL:
ERR020: PRINT/ ' End of Drawings'
PRINT/ ' Terminating program.'
JUMP/ CANCEL:
ERR030: PRINT/ ' Dwg width size could NOT be determined'
JUMP/ CANCEL:
ERR040: PRINT/' INVALID DWG SIZE, CHANGE EXISTING DWG SIZE AND TRY AGAIN.'
JUMP/ CANCEL:
ERR050: PRINT/ ' Error deleting dwg pg ''x''...'
JUMP/ CANCEL:
ERR999: PRINT/' This routine not working YET for this size dwg sht.'
PRINT/' Terminating program'
JUMP/ CANCEL:
CANCEL: &CURDRW=INFO
MESSG/ ' READ THE INFO DIALOGUE BOX FOR IMPORTANT INFORMATION'
PRINT/ ' '
PRINT/ ' *************************************************************'
PRINT/ ' It''s the detailers responsibility to ensure that formats'
PRINT/ ' have been swapped out correctly, ESPECIALLY with LEGACY drawings.'
PRINT/ ' In the past, Some patterns have been:'
PRINT/ ' *Put on incorrect layers'
PRINT/ ' *Expanded into the dwg sheet view, so that it''s no longer'
PRINT/ ' a pattern.'
PRINT/ ' *And just about everything else you can think of...'
PRINT/ ' '
PRINT/ ' This routine does not check or correct these format problems.'
PRINT/ ' ADDITIONALLY, you are responsible for any text additions or'
PRINT/ ' deletions that need to take place with updating formats.'
PRINT/ ' *************************************************************'
&WLAYER = 250 $$ Restore work layer
HALT
Regards,
SS
CAD should pay for itself, shouldn't it?