Insert skp directly into sketchup like 3d warehouse

I made this little plugin that opens a page inside SketchUp, but I can’t make the links that download skp work and insert the files in SketchUp.
If my website links to skp files, is it possible?

require 'sketchup'

module MyPlugin
  def self.open_website
    # Create a new HTML dialog
    dialog =
    # Set the width and height of the HTML dialog
    dialog.set_size(800, 600)
    # Set the URL of the HTML dialog
    # Set the callback for link clicks
    dialog.add_action_callback("link_clicked") { |dialog, params|
      # Get the clicked link URL from the action value
      link_url = params
      # Load the clicked URL in the same HTML dialog
    # Show the HTML dialog

unless file_loaded?(__FILE__)
  cmd ="Open Website") { MyPlugin.open_website }
  cmd.tooltip = "Opens a specified website"
  cmd.status_bar_text = "Opens a specified website"
  cmd.menu_text = "Open Website"
  toolbar = "My Toolbar"
  toolbar = toolbar.add_item cmd

The #add_action_callback method establishes a Ruby callback method that your html dialog can call to perform some function.

Since in your example the Html/JavaScript code is not yours (you set an url of public site), the referred sketchup.link_clicked(...)
JavaScript method is not there. So it will not works as you think.

You need to set up on your ow website where you can place the JavaScript counterpart of the code… then pass the url of your file to e.g.: load_from_url:

The DefinitionList #load_from_url method loads a component from a location specified by string url.

Then you can use:
Model #place_component-instance_method