You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the bottom of the Licenseing tutorial module ... "master/examples/99_license/ex_hello_license/main.rb"
# Fetching a license here so that it will be checked by SketchUp during# startup. This will include the extension in the dialog that warns about# missing licenses.ext_id='6cce9800-40b0-4dd9-9671-8d55a05ae1e8'ext_lic=Sketchup::Licensing.get_extension_license(ext_id)
This is a bit contradictory to the text in the self.create_cube method.
How about wrapping it within an init method ?
defself.init# Fetching a license here so that it will be checked by SketchUp during# startup. This will include the extension in the dialog that warns about# missing licenses.ext_id='6cce9800-40b0-4dd9-9671-8d55a05ae1e8'ext_lic=Sketchup::Licensing.get_extension_license(ext_id)endself.init()
... or don't assign the results to local variables?
Yes, looking at this again after a long time, ... the latter would be much better.
There is no point in assigning the results to local variables within the submodule as they are never used.
All we care about is that the Extension Manager gets a chance to check the licensing during the load cycle.
Also in the "ex_hello_license/main.rb" file, It is not necessary to assign local variables.
Instance variables can also be seen. The example has a blocking message box that would allow the variables to exist whilst the modal window is open.
Perhaps:
unlessSketchup::Licensing.get_extension_license('6cce9800-40b0-4dd9-9671-8d55a05ae1e8').licensed?UI::messagebox('Could not obtain a valid license.')returnend
... or ...
ext_id='6cce9800-40b0-4dd9-9671-8d55a05ae1e8'license=Sketchup::Licensing.get_extension_license(ext_id)bailout=license.licensed?ex_id=license=nilGC.startifbailoutUI::messagebox('Could not obtain a valid license.')returnend
At the bottom of the Licenseing tutorial module ...
"master/examples/99_license/ex_hello_license/main.rb"
This is a bit contradictory to the text in the
self.create_cube
method.How about wrapping it within an
init
method ?... or don't assign the results to local variables?
?
The text was updated successfully, but these errors were encountered: