Be careful with send_action codes. They are strings, and strings are error-prone because they can contain typos (static code analysis wonât detect such errors). At least this method send_action returns false (you could check the return value).
You can always set the camera directly (as you tried in the commented-out code), but you need some understanding of space and it is not easy to find the same eye and target that the action code uses. But you could use the action code, then get the camera position and orientation and modify the camera afterwards.
For example for top right, you apply the action viewTop (which is probably front top), get the eye and target and rotate the up vector by 90°. The up vector is probably [0, 1, 0] and when you set it to [-1, 0, 0] it will show the view from the right. Then apply the modified camera to the view.
An example for installing gems can be found e.g. in SketchUpâs testup project:
In order to load a gem, you need to require ârubygemsâ (which is preinstalled in the standard library).
If your gem is not installed, you need to install it (this can freeze SketchUp for some time).
Installing gems can fail, so you need to handle that case as well (e.g. if your plugin cannot fallback to work without that gem, display a message to the user).