RBE prerequise

Hi all,
I do a ruby extension that work on my mac.
I sign and script my extension on https://extensions.sketchup.com/extension/sign

Sadly a part of my code doesn’t work when I use the new rbz file. (mac os x, SU2020pro)

module Adebeo::Simpletool
	# ...
	class Tool
		# ...
		def initialize
			# ...
			@model=Sketchup.active_model
			@colorSurbrillance1 = Sketchup::Color.new('green')
			# ...
		end

		def draw(view)
		  	return if view.nil?
			# ...
			view.drawing_color = @colorSurbrillance1
			# ...
		end

		def function
		   if @model.selection
		   #.....
	# ...
	end
end

The console show

Error: #<TypeError: no implicit conversion to Color>
/users/…rbe:445:in `drawing_color=’

or

Error: #<NoMethodError: undefined method `selection’ for nil:NilClass>

@ variable have been turn to nil ?

Thanks for your help.
If you can link a ressource on rbe prerequise

This indicates that the model object is not yet ready on MacOS platform.

I would think this could be caused by activating the tool during the SketchUp startup cycle (which is a “no-no”.)

The weird thing is that the Tools collection and the View are objects belonging to the active model, so how could a Ruby tool get activated ?.

emmmmm to be frank since SU2019 I always type out literally Sketchup.active_model in every block…

Thanks dan for your answer,
Sorry for two things:

  • I forget to mention that the tool works normally. My message was not clear. Your message give me the idea why it did work. It was a small typo in the initialize function of my tool. I was suspected the rbe because it was the first use for me.

  • I don’t understand “no-no”

Thanks !

I use @model since 2010, it was a typo. sorry for disturbing you

Nah it’s ok Haha

“no-no” = “do not do this”

So this issue is solved?

And the topic title is misleading then (the issue is not related to RBE encryption)?