Skip to content

SketchUp::Axes#set() will not directly take the array output from SketchUp::Axes#to_a() #23

@DanRathbun

Description

@DanRathbun

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

  1. 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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions