.erase! bug ? or is it me...
-
Hi,
I'm getting bug splat doing that:
def my_function Sketchup.active_model.start_operation p1=Geom;;Point3d.new(0,0,0) p1=Geom;;Point3d.new(100,100,100) e=Sketchup.active_model.entities.add_line(p1,p2) g=Sketchup.active_model.entities.add_group(e) g.erase! if g.valid? #ALWAYS CAUSES A BUG SPLAT Sketchup.active_model.commit_operation endWhen NO start/commit instructions are done, no bug splat.

Workaround:
def my_function Sketchup.active_model.start_operation p1=Geom;;Point3d.new(0,0,0) p1=Geom;;Point3d.new(100,100,100) e=Sketchup.active_model.entities.add_line(p1,p2) g=Sketchup.active_model.entities.add_group(e) UI.start_timer(0,false) { g.erase! if g.valid? } Sketchup.active_model.commit_operation endNo more bug splat but the start_timer seems to do itself a 'commit' so the function is no more one-click undo-able.
Anyone has a better solution to avoid bug splats within star/commit ?
Help greatly appreciated !!! -
have you tried using:
Sketchup.active_model.entities.erase_entities(array_of_entities)I think I have got bug splats from using erase! before but when I tried the using the above code, it worked fine.
-
I'm having the same problem with SU bugsplatting when trying to delete a valid entity. Doesn't matter what delete operation I do. I keep bugsplatting.
If I remove the start_operation line it doesn't bugsplat while running. But seem to terminate early. And when I afterwards do a Revert or try to make a new model SU will bugsplat.
-
Thanks Whaat, it seems to works here too, even with a single element array.
Fingers crossed !
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