cant save project macro

nubrandao
Advocate
Advocate

cant save project macro

nubrandao
Advocate
Advocate

hi guys, i have a macro that load model by model from a folder and apply a strategy then reset project and load another one.

 

but i want to save each model it load, if i have  5 models, i want to apply a strategy in each model but needs to save.

 

DIALOGS MESSAGE OFF
DIALOGS ERROR OFF

STRING DIR = "C:\TEMP\"
STRING LIST LST = list_files("all", $DIR)

FOREACH line IN LST {


IMPORT MODEL $LINE
FORM BLOCK
EDIT BLOCK RESET
BLOCK ACCEPT
CREATE TOOL ; BALLNOSED FORM TOOL
EDIT TOOL "1" DIAMETER "35"
TOOL ACCEPT
FORM STRATEGYSELECTOR
EDIT PAR "CornerRadius.Active" "0"
EDIT PAR "ResourceAllocation" 70
STRATEGYSELECTOR STRATEGY "Finishing/Raster-Finishing.002.ptf" NEW

IMPORT TEMPLATE ENTITY TOOLPATH TMPLTSELECTORGUI "Finishing/Raster-Finishing.002.ptf"

EDIT TOOLPATH "1" CALCULATE
FORM ACCEPT SFRasterFin


STRING LIST models = {}
FOREACH md IN FOLDER('model') {
IF position($md.name, "Planes") == -1 {
INT k = add_last($models, $md.name)
}
}

STRING PATH0 = "C:\nuno\"
STRING SaveAs = $PATH0 + $modelname

PROJECT SAVE AS $saveas
PROJECT RESET
No
}

0 Likes
Reply
Accepted solutions (1)
222 Views
1 Reply
Reply (1)

nubrandao
Advocate
Advocate
Accepted solution

solved

 


DIALOGS MESSAGE off
DIALOGS ERROR Off

STRING DIR = "C:\TEMP\"
STRING LIST LST = list_files("all", $DIR)

FOREACH line IN LST {

reset localvars
IMPORT MODEL $LINE
FORM BLOCK
EDIT BLOCK RESET
BLOCK ACCEPT
CREATE TOOL ; BALLNOSED FORM TOOL
EDIT TOOL "1" DIAMETER "35"
TOOL ACCEPT
FORM STRATEGYSELECTOR
EDIT PAR "CornerRadius.Active" "0"
EDIT PAR "ResourceAllocation" 70
STRATEGYSELECTOR STRATEGY "Finishing/Raster-Finishing.002.ptf" NEW

IMPORT TEMPLATE ENTITY TOOLPATH TMPLTSELECTORGUI "Finishing/Raster-Finishing.002.ptf"

EDIT TOOLPATH "1" CALCULATE
FORM ACCEPT SFRasterFin


STRING LIST models = {}
FOREACH md IN FOLDER('model') {
IF position($md.name, "Planes") == -1 {
INT k = add_last($models, $md.name)
}


}

 

STRING PATH0 = "C:\nuno\"
STRING SaveAs = $PATH0 + $models[0]
print $saveas
PROJECT SAVE AS $saveas

PROJECT RESET
yes
}

0 Likes