sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Start_operation backward compatibility

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 3 Posters 422 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.
    • J Offline
      Jim
      last edited by

      Since I'm sure everyone wants to take advantage of the speed improvements in SU7 by using the new start_operation syntax:

      
      Sketchup.active_model.start_operation("Draw a Boat-Load of Geometry", true)
      
      

      and also retain backward compatibility; what's a good way to code this up? I guess this would work:

      
      if Sketchup.version.split(".")[0].to_i >= 7
        Sketchup.active_model.start_operation("Draw a Boat-Load of Geometry", true)
      else
        Sketchup.active_model.start_operation("Draw a Boat-Load of Geometry")
      end
      
      

      Is this a case where over-loading start_operation would be a good thing?

      Hi

      1 Reply Last reply Reply Quote 0
      • A Offline
        azuby
        last edited by

        But when using old plugins with new Sketchup you need to make sure your overwriting code is loaded before the old plugins are loaded. Maybe you want to program a "Load Old Plugins" Plugin, put the old plugins into a separate folder, ...

        For your if-statement: Sketchup.version[0,1].to_i

        azuby

        *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

        Bad English? PM me, correct me. :smile:**

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

          Thanks for the tip. I just made use of it and it's working good. Operation took abtou 2 minutes in SU6 while no more than 30 seconds in SU7.

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

          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