Problem with VS Code configuration

When SketchUp starts it processes the several “Plugins” folders and evaluates the .rb files it finds.
As explained in the documentation for the SketchupExtension class, these data objects in registrar files are registered with SketchUp’s ExtensionManager using the Sketchup::register_extension() module method.

If the user’s load setting for a particular extension is set true, the extension manager will (at the time of registration,) call the SketchupExtension instance’s internal #load method which is a glorified Sketchup::require(@path) call with a little bit of other housekeeping.

(Note: You can actually read the "extensions.rb" file yourself. It is located in the "Tools" subfolder of SketchUp’s %ProgramFiles% folder.)


So, re “entry points”, since SketchUp Ruby is a subprocess of an application, SketchUp extension code objects are really event-driven code. An extension submodule defines it’s entry points as two kinds of things.

Direct user entry: UI::Command objects assigned to Menu items or Toolbar buttons; context menu procs, or Importers chosen from the native import dialog. The user directly causes a part of the extension code to execute by purposefully choosing a task such as clicking a menu item, clicking a toolbar button, hitting a particular assigned keychord shortcut, or choosing a file of a certain type to import from a browse dialog.

Often a command might active a custom Ruby Tool that the extension implements.

  • For simplicity in development, command procs should normally call a command method so that bugs can be fixed, the code can be reloaded, the method redefined and retested without having to exit and restart SketchUp.

Indirect event entry: The various Observer classes allow extensions to “piggyback” upon application, model, collection or entity events. These are indirectly caused by the user during normal application use such as opening a model file for edit, selecting entity objects, making edits, changing options, manipulating the viewport, loading resources, saving models, closing the application, etc.


So for SketchUp extensions, the code objects are modules (your top level unique Namespace module wrapping extension submodules) that have command methods waiting for users to fire them, or observers watching either the application’s objects or a model’s objects (collections and/or entities.)

This is event driven code.

It is possible when your modules load to have code evaluated to setup things. This setup code is not within methods or procs.