-
Notifications
You must be signed in to change notification settings - Fork 9
Description
SketchUp Ruby API Issue
Oversight Report (FR for Improvement)
1. SketchUp Version: 2016, 2018 (likely also 2017)
2. OS Platform: Windows
Symptoms
SketchUp::Axes#set() will not directly take the array output from SketchUp::Axes#to_a().
An ArgumentError: wrong number of arguments 1 for 4 exception is raised.
This causes the forced use of the Ruby splat (*) operator.
# Complete reproducible code snippet:
Sketchup.active_model.axes.set(Sketchup.active_model.axes.to_a)
#=> Error: #<ArgumentError: wrong number of arguments (1 for 4)>
#=> <main>:in `set'(See Note 1 below.)
Expectations
We'd expect such a simple method to accept an array or parameters, especially the output of the "properties" method of the same class.
Feature Request
- Allow use of array.
NOTES:
(1) The above snippet is not really something that would be used, as it describes a no-op. Ie, it (if it worked) would set the drawing axes to what it is already set to. In reality, a coder would save the current axes settings using the #to_a method, change the axes temporarily and then wish to restore the previous axes by passing the saved array back into the #set method.
prev = model.axes.to_a
# Change the axes
# Add some geometry using the drawing axes transformation
model.axes.set(prev)