Please do not create duplicate posts !
(The Moderator has removed the duplicate post in the linked topic thread.)
Your problem comes from using Sketchup::find_support_file,
which is for searching the application’s support directories, not appdata directories.
Use the Ruby global __dir__ method along with Ruby File::join method.
Also, always test for valid paths before using them.
filename = "KBU1DR.skp"
path = File.join( __dir__, "standard_module/kitchen", filename )
if File.exist?(path)
model = Sketchup.active_model
definitions = model.definitions
@kbu1dr = model.definitions.load( path )
if @kbu1dr # nil if the definition could not load
model.place_component(@kbu1dr)
else
UI.messagebox(
"Error: Could not load component: \"#{File.basename(filename,".*")}\""
)
end
else
UI.messagebox(
"Error: Could not find file: \"#{filename}\" at path:\n\"#{File.dirname(path)}\""
)
end
Your example has an error where you assign a constant reference KBU1DR to the command, but then in it’s execute block you assign a definition reference to the same constant name. Temporary references should never be constants. They should be local or instance variables.