{*********************************************} { Umbenennen aller gleichnamigen Teile } { Rename all parts with the same name } { 1.PARAMETER the old Partname } { 2.PARAMETER the new Partname } {Example: Rename_multiple_parts 'micky' 'maus'} { Mit freundlicher Genehmigung von } { Paul Romanowsky und Fabio Zoccarato als } { amerik.-ital.-deutsche Coproduktion } DEFINE Rename_multiple_parts PARAMETER Old_partname PARAMETER New_partname LOCAL Id_current_part LOCAL Counter CREATE_LTAB 10 6 'temp_ltab' PB_LTAB_UPDATE INQ_ENV 7 LET Id_current_part (INQ 302) EDIT_PART TOP LET Counter 1 REPEAT IF ((READ_LTAB 'PBT_LTAB' Counter 6)<>' ') TRAP_ERROR PART_ICON (Counter -1) IF (CHECK_ERROR) END END_IF END_IF LET Counter (Counter+1) UNTIL (Counter > LTAB_ROWS 'PBT_LTAB') SELECT_FROM_LTAB 'PBT_LTAB' 1 = ('*'+Old_partname+'*') 'temp_ltab' END LET Counter 1 WHILE (Counter <= LTAB_ROWS 'temp_ltab') EDIT_PART (READ_LTAB 'temp_ltab' Counter 2) INQ_ENV 7 IF (TRIM (INQ 301)=Old_partname) RENAME_PART New_partname END_IF LET Counter (Counter+1) END_WHILE EDIT_PART ('~'+STR (Id_current_part)) END_DEFINE {Beispiel einer interaktiven Benutzung um alle } {Teile umzubenennen, die den gleichen Namen haben} {wie das aktive Teil } {Example for interaktiv use to rename all parts } {with the same name like the current part. } DEFINE rmp LOCAL Old_pn LOCAL New_pn INQ_ENV 7 LET Old_pn (STR (INQ 301)) {READ STRING PROMPT ('Type the new Partname for all parts like '+Old_pn) DEFAULT Old_pn New_pn } READ STRING PROMPT ('Gib den neuen Teilenamen fuer alle Teile '+Old_pn+' ein!') DEFAULT Old_pn New_pn Rename_multiple_parts Old_pn New_pn END_DEFINE