Then I use on openFile methond in ruby to import the model.
def self.openFile
model = Sketchup.active_model
status = model.import 'C://Users//userMe//model.skp'
end
When I create a new model I am replacing/overwriting “model.skp”. However my openFile opens the old model. I created a function in C++ to remove the file after its been imported. But it still finds the old model everytime. When I go to the folder and open up the model.skp file its the new model! Any thoughts?
VALUE removeFile(){
if (remove("C://Users//userMe//model.skp") != 0){
perror("Error deleting file");
return Qfalse;
}
else
return Qtrue;
}
You may need to “difference” the active model from the state it was when last saved.
(Whenever the active model is saved, the “modified” flag gets reset to false, and the engine sees the call to reload the same file as unnecessary.)
You might also clear the active model’s entities before the import ?
Thanks for the help. I ended up changing model.skp to #.skp where # = the number of faces in each model. This way each time I went through it created a unique file.