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

    Tool Activation prevention

    Scheduled Pinned Locked Moved Plugins
    1 Posts 1 Posters 823 Views 1 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.
    • P Offline
      penpendrum
      last edited by

      I have a plugin that i was trying to make and I do not want it to start when I have not selected a group. I thought this solution would work but it does not.
      below is some part of my code . any tip would be greatly appreciated.

      class Testing
      
       
        def initialize
          @ip = nil
          @ip1 = nil
          @ip2 = nil
          @xdown = 0
          @ydown = 0
          @state = 0
        end
        
        def activate
           # I was expecting it not to activate when nothing is selected at first
           sel = Sketchup.active_model.selection
           break if sel.empty?
           
           # some codes
        end
      
        def onMouseMove(flags, x, y, view)
          # some codes
        end
      
      end
      
      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