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

    Question:small_icon = and large_icon= method of UI::Command

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

      
      if( not $terrain_CreateFromContours_loaded )
          cmd = UI;;Command.new($tStrings.GetString("From Contours")) { Sketchup;;active_model.select_tool FromContoursTool.new }
          cmd.small_icon = "Images/tbContoursSmall.png"
          cmd.large_icon = "Images/tbContoursLarge.png"
          cmd.tooltip = $tStrings.GetString("From Contours")
          cmd.status_bar_text = $tStrings.GetString("Create a Sandbox from contours")
          cmd.menu_text = $tStrings.GetString("From Contours")
          $draw_terrain_submenu.add_item(cmd)
          tb.add_item(cmd)    
          $terrain_CreateFromContours_loaded = true
      end
      
      

      This is a section of code in "sandboxmenus.rb" file.
      It works well!
      But,I do't understand this line
      small_icon = "Images/tbContoursSmall.png"
      Both the "images" folder and it‘s upper folder,"Sandbox", are not in the searching path!
      How could Sketchup find the img file?
      Does sketchup find file in every sub folder in searching path?

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        I think it's because the path is taken relative to the path of the calling script's folder. Since script is in a folder that contains the images/... folder. then it is found OK...

        TIG

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          @tig said:

          I think it's because the path is taken relative to the path of the calling script's folder. Since script is in a folder that contains the images/... folder. then it is found OK...

          unless the script has been scrambled, in which case the relative path no longer works and you need to use the full path to the images.

          Hi

          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