Retrieve a value from status bar input box
-
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
-
its a text string, so do:
the_input_string.split(',') to get an array of values
-
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_ffor floats etc... -
hi tig,
thanx,
at the moment i have a problem with understanding the tool activation and the activation the VCBin the api the explanantion is still not quite clear to me... t take time
stan -
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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement