Delete all scenes?
-
I have a need to delete all scenes from my ruby script. I read somewhere that this is not possible, but I did find model.pages.erase: http://code.google.com/apis/sketchup/docs/ourdoc/pages.html#erase.
I thought that this code would work, but it splats for me:
pgs = Array.new model.pages.each {|pg| pgs.push pg} pgs.each {|pg| model.pages.erase pg}Any ideas? CB.
-
I think you just missed out the
model = Sketchup.active_modelThis works for me:
model = Sketchup.active_model pgs = Array.new model.pages.each {|pg| pgs.push pg} pgs.each {|pg| model.pages.erase pg} -
Remus's code works on v7, BUT not on v6.
There is no equivalent to model.pages.erase(page) till v7...
-
Ah, that's the confusion (v6 vs v7).
I had set model earlier in the script.
My splat seems to be related to undoing the erasures, and then erasing them again. Will require more investigation. -
Seems I can create this splat fairly easily without using ruby at all. Just open a model that has one scene, and then delete that scene. Then close SU, and it will splat. At least for me.
-
Interesting, I'm not seeing that. Perhaps you have a ruby installed that is conflicting. You might need to test which ruby it is.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement