Macro "Batch Part Number Rename"

marcofa

Utente Standard
Professione: Manager
Software: Autocad Catia
Regione: Liguria
#1
Su Eng-Tips ho trovato la Macro allegata.
Essa dovrebbe cambiare il "Numero parte" e renderlo uguale a "Nome del file" , se non ho capito male. Sarebbe utile per il "Nuovo da" su Product, dove il Numero parte resta vecchio ed il Nome file diventa nuovo.
Poichè non riesco ad utilizzarla, qualcuno potrebbe provarla e spiegare come si fà?
Grazie
Marco
 

Allegati

marcofa

Utente Standard
Professione: Manager
Software: Autocad Catia
Regione: Liguria
#2
Su gtwiki ho trovato lo script che fà al caso mio, e cioè rinomina i "Numeri Parte" come il "Nome File"
Nel caso di Product creato con il comando "Nuovo da" i Numeri parte non vengono cambiati, ma solo i Nomi File.
Eseguendo questo script dopo il comando Nuovo da, si otterranno nuovi Numeri Parte coincidenti con i nuovi Nomi File.
Questo script è un CatVba.
Qualcuno potrebbe dirmi per favore come si lancia?
Marco

PartNumber Renamer by File Name

Often, users will name the PartNumber and File Name differently.

To clear up some confusion,
The PartNumber is the parameter that controls the CATPart/CATProduct name. It resides in the file and exists at the top of the Digital Project tree structure.
The File Name is the title of the file, and it usually ends with ".CATPart" or ".CATProduct. It is only accessible from Windows Explorer or other directory structure interfaces. You can view a read-only version of this name in Digital Project under File > Document Properties > Document.

In the process of developing an assembly, some users would like to coordinate differing the names. This script changes the PARTNUMBER to match the FILE NAME.

Script Download
Click Here to Download the Script.

http://www.gtwiki.org/mwiki/index.php?title=PartNumber_Renamer_by_File_Name

Important things to note
The changes are permanent. If you select a directory and choose the option to recursive cycle through all sub-directories, it will rename everything. There is no Cancel or "Stop Script.
CATProducts that hold onto changed CATParts will lose the links. It's recommended that users only utilize this script for CATPart directories, but the option is open.
When converting CATProducts, you'll probably be prompted with the Desk Management dialog box. Ignore this until the script has finished--it will not impact the performance of the code and you can cancel them all at the end of the procedure.
The equals sign (=) cannot be in the File Name of a CATProduct. You will be able to save the name, but the PartNumber will not accept that string of characters. The script will not prompt you with an error and CATParts allow equals signs in the File Name and PartNumber.