• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Retrieve a value from status bar input box

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 3 Posters 346 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.
  • A Offline
    artmusicstudio
    last edited by 24 Jun 2014, 11:00

    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
    • A Offline
      AdamB
      last edited by 24 Jun 2014, 13:52

      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
      • T Offline
        TIG Moderator
        last edited by 24 Jun 2014, 14:04

        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
        • A Offline
          artmusicstudio
          last edited by 27 Jun 2014, 08:43

          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
          • T Offline
            TIG Moderator
            last edited by 27 Jun 2014, 08:53

            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
            1 / 1
            • First post
              1/5
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement