.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 end
When 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 end
No 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 !
Advertisement