- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to renumber the nc programs but the macro that I created starts with the assigned number plus one.
Could someone help me solve this little problem?
attached macro and images;
//ESTA MACRO NUMERA LOS NCPROGRAMS
Reset localvars
//Comprueba si deseas numerar los NCPrograms
string yesorno = "Click SI,para renumerar Ncprograms." + crlf + "Click NO,para cancelar la macro"
bool yes = 0
$yes = QUERY $yesorno
IF yes {
STRING $nombre = ""
INT $COUNT = INPUT "Introduce numero de programa"
// Numerar todos los Ncprograms o solo las seleccionadas
string allorno = "Click SI,para numerar todos los Ncprograms." + crlf + "Click NO,otras opciones"
bool yes = 0
$yes = QUERY $allorno
IF $yes == 1 {
// Numerar todos los Ncprograms
FOREACH Ncp IN folder('NCProgram') {
ACTIVATE NCPROGRAM $Ncp.name
$COUNT = $COUNT + 1
STRING NewName = ($nombre + $COUNT)
RENAME NCPROGRAM ; $NewName
}
}
Thanks
Alex
Solved! Go to Solution.