💡 LightUp 7.1 | SketchUp's only real-time renderer that uses object-based rendering
Download Trial
Return values from ruby system calls
-
This should be really simple, but for some reason I cannot get any return values from simple Ruby system calls from within Sketchup...for example:
puts `echo test` # nil result x = `echo test` # nil result puts x # nil result x.empty? # true system('echo test') # true
Strangely the system('echo test') returns true, indicating that the process was successfully run...does anyone have any ideas? I'd like to avoid having to use txt or csv files as intermediaries.
Thanks,
Sebastian -
v8 users the really old ruby version...
so try "test" for your stringand also try
x = %x(echo "test")
-
SketchUp 2014 was bugged in this regard. The workaround was to pipe to a text file, I think.
I think it was fixed in SketchUp 2015.I recall having written a patch script that overrode the Kernel.backquote method. (I have to have a look for it.)
Advertisement