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

    Retrieve a value from status bar input box

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 348 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.
    • artmusicstudioA Offline
      artmusicstudio
      last edited by

      hi,
      in this topic i found the basic code for retrieving an user input.

      http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=9828

      but i don't know, which arguments are to be sent to the method
      and which is the return value.

      i would like to implement a numerical input in form

      value 1 , value 2, value 3 (where user puts in 1,5,2 with commas),

      at the position in my code, where one face is selected

      and the input controlls further operations.

      i would liek to use the status bar input instead of the UI.messagebox.

      thanx in advance for ideas!

      stan

      1 Reply Last reply Reply Quote 0
      • AdamBA Offline
        AdamB
        last edited by

        its a text string, so do:

        the_input_string.split(',') to get an array of values

        Developer of LightUp Click for website

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

          Yes.
          Assuming the input is 'valid' and that it is not triggering any Shortcuts...
          You get "1,2,3" as the 'text'... so split it thus:
          values=text.split(',')
          which gives you:
          ["1", "2", "3"]
          Then to get them as integers
          x=values[0].to_i
          and so on,
          or perhaps .to_f for floats etc...

          TIG

          1 Reply Last reply Reply Quote 0
          • artmusicstudioA Offline
            artmusicstudio
            last edited by

            hi tig,
            thanx,
            at the moment i have a problem with understanding the tool activation and the activation the VCB

            ( >> http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=52825%26amp;p=480058%26amp;hilit=activate+vcb#p480058)

            in the api the explanantion is still not quite clear to me... t take time
            stan

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

              You have to make a 'class'.
              SketchUp recognizes it as a 'Tool' from the way it is made into a command...
              Special 'Tool' methods can be used in that class...

              Go to the Extension-Warehouse and find the Examples - the 'draw box' example shows how to set up a Tool...
              https://extensions.sketchup.com/en/content/example-ruby-scripts

              TIG

              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