Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for no open models in start_with_empty_model. #226

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/testup/sketchup_test_utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ module SketchUpTestUtilities
# rubocop:disable SketchupSuggestions/ModelEntities
def start_with_empty_model
model = Sketchup.active_model
# In case no model is open on mac.
if model.nil?
Sketchup.file_new
model = Sketchup.active_model
end
model.abort_operation # Incase any operation is left hanging open.
model.active_view.camera.aspect_ratio = 0.0
model.start_operation('TestUp Empty Model', true)
Expand Down
Loading