sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    .erase! bug ? or is it me...

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 512 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Didier BurD Offline
      Didier Bur
      last edited by

      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 !!!

      DB

      1 Reply Last reply Reply Quote 0
      • W Offline
        Whaat
        last edited by

        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.

        SketchUp Plugins for Professionals

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          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.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • Didier BurD Offline
            Didier Bur
            last edited by

            Thanks Whaat, it seems to works here too, even with a single element array.
            Fingers crossed !

            DB

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement