Here is and example of my code.
In order for this macro to work, I have to include a macro pause "" after
EXPORT MODEL $MODEL FILESAVE
$modelexp
If I block out the Macro pause as shown in the example it errors out.
//////////// Explorer Stuff///////////////////////
// Removes selected items from explorer variable
EXPLORER SELECT Model ROOT
Macro Pause "Select Desired Models"
IF is_empty(explorer_selected_entities()) {
Macro Pause "Make sure to select your Models"
}
// Loops Through Models
FOREACH MODEL IN explorer_selected_entities() {
FORM MODELTRANS EDIT MODEL $MODEL INTERACTIVE
TRANSFORM TYPE WORLD TRANSFORM MODEL $MODEL
// Example of code from macro record
//EXPORT MODEL "433204_DT03_EJECTOR_INSERT" FILESAVE
//"C:\cnc\5.5\WP_Macros\test.stl"
// Model save path
string modelexp = "C:\cnc\5.5\WP_Macros\" + $model.name
DELETE FILE $modelexp
EXPORT MODEL $MODEL FILESAVE
$modelexp
//macro pause ""
TRANSFORM TYPE WORKPLANE TRANSFORM MODEL $MODEL
}
Solved! Go to Solution.
Solved by rafael.sansao. Go to Solution.
Replace:
// Model save path
string modelexp = "C:\cnc\5.5\WP_Macros\" + $model.name
DELETE FILE $modelexp
EXPORT MODEL $MODEL FILESAVE
$modelexp
By:
// Model save path
string modelexp = "C:\cnc\5.5\WP_Macros\" + $model.name + ".stl"
DELETE FILE $modelexp
EXPORT MODEL $MODEL $modelexp
Rafael Sansão
Can't find what you're looking for? Ask the community or share your knowledge.