Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1fe1c8d5a8 | |||
| ac58560a69 |
@@ -3,6 +3,7 @@
|
||||
require 'JSON'
|
||||
require_relative '../ext/sqlite3'
|
||||
require_relative '../constants/path_constants'
|
||||
require_relative '../preferences/preferences'
|
||||
|
||||
module SpeckleConnector3
|
||||
# Accounts to communicate with models on user's account.
|
||||
@@ -11,11 +12,11 @@ module SpeckleConnector3
|
||||
def self.load_accounts
|
||||
db_path = SPECKLE_ACCOUNTS_DB_PATH
|
||||
unless File.exist?(db_path)
|
||||
raise(
|
||||
IOError,
|
||||
"No Accounts db found. Please read the guide for different options for adding your account:\n
|
||||
https://speckle.guide/user/manager.html#adding-accounts"
|
||||
)
|
||||
File.new(SPECKLE_ACCOUNTS_DB_PATH, "w")
|
||||
db = Sqlite3::Database.new(SPECKLE_ACCOUNTS_DB_PATH)
|
||||
Preferences.create_objects_table(db)
|
||||
db.close
|
||||
return []
|
||||
end
|
||||
|
||||
db = Sqlite3::Database.new(db_path)
|
||||
|
||||
@@ -26,7 +26,7 @@ module SpeckleConnector3
|
||||
_run(*parameters)
|
||||
end
|
||||
rescue StandardError => e
|
||||
action = Actions::HandleError.new(e, @binding.name, @action, parameters)
|
||||
action = Actions::HandleError.new(e, @binding.nil? ? "unknown binding" : @binding.name, @action, parameters)
|
||||
app.update_state!(action)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,6 +9,8 @@ module SpeckleConnector3
|
||||
# @return [UI::Command] the command that can be added to Sketchup menu or toolbar
|
||||
def self.sketchup_command(command, menu_text)
|
||||
UI::Command.new(menu_text) do
|
||||
puts '### COMMAND CALLED BY MENU ###'
|
||||
puts "Name: #{menu_text}"
|
||||
command.run
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user