Ruby- Gets doesn't wait for user input

Something about the implementation of the Ruby API seems to mean ( ‘gets’) doesn’t work. It is skipped over & appears to be ‘nil’.

Any alternatives?

This is the method

1 Like

Gets doesn’t work within the SketchUp Ruby api because it reads from standard input, which is not accessible from the embedded interpreter.

Depending on your code structure and needs, there are various alternatives. For example a UI.inputbox can provide a text input box. A HtmlDialog can also provide text input fields. A Tool can get keyboard and text inputs via its callback methods.

1 Like