Is it possible to create a command to import an item into sketchup?

I’m not sure where to ask this but I was thinking about creating my own catalog of sketchup components that you can access from outside of sketchup. For example a spreadsheet or database that would have a viewable catalog of components (basic info with a screenshot) and then a button to send it an open sketchup window or the ability to drag it into sketchup? i feel like a script could do this or at the very least open a local file location to drag the file into sketchup?

You can set a shortcut to open the import window, but I’m not sure if it’s possible to set a shortcut to import an specific file every time you hit it, you can add your component libraries to a sketchup file and then make a template so every time you open that template you’ll have all your models on the components tray without needing to import every time you open a new file.

Not sure exactly what you’re after. I interpret, “…access from outside of SketchUp” to mean something like, “Without opening SketchUp”.

You can save thumbnails in Trimble Connect and display those.

Otherwise it seems like you’d need a extension. The code here can make clickable images:

Create HtmlDialog with clickable thumbnails - Developers / Ruby API - SketchUp Community

Or something like this (at the bottom):

IDK Compilation - Extensions - SketchUp Community

I don’t think an extension is necessary since there are at least three native ways of doing this, the simplest being to have (multiple) windows explorers open with the view set to thumbnails::


The second best might be to add certain folders with components as a local collection:


Learn more, here:

ofcourse, depending on your situation (eg. are you part of a large organisation or not, or do you need to have access to those collections on different platforms or machines, one can leverage collections in the 3D Warehouse:

or see this post:

1 Like

Wouldn’t doing this increase the loading time of SketchUp?

It would increase the loading time of sketchup indeed.

There were some reports where this had impact on downloading components, Mac platform specific.
There are a bunch of collections in the standard installation folders, I wonder if deleting them would have impact.

On windows, I don’t see a difference, but my collections might not be large enough.

Closing the Component dialog before closing SketchUp might have influence, too.

After all, it’s just adding some paths in the preferences json, when you open the collection, it’s time to generate the thumbnails, I would presume.

On Mac, I have always tend to believe that (re)starting SketchUp several times after adding collections would speed up things, as if the Operating System indexes certain aspects (most used apps and paths)

Did a quick test with extension on folders in external drive. Thumbnails are saved in selected folder. Paths aren’t created until folder is selected. Slower to generate thumbnails but probably not slower to load.

I was saying this related to this I read SketchUp takes a while to start up - #8 by colin

I need to go through the links provided still, but the workflow I was trying to achieve is we have a group of designers that don’t use SketchUp. They source items and add them to this database per project. I’m starting build a decent catalog of components that we reuse, but it would be easier for me if I could easily import those components straight from this database that they create and drop the already modeled components directly into my open SketchUp file. Think one monitor has this database up the other has SketchUp, drag and drop or click on something that imports it. The flip side is that then they can browse all the existing components in this database to make choices, again they don’t have SU or Trimble accounts to browse from there.

What format are they “adding” to this database in?

They add entries to a database, url links to actual products, unmodled at that point.

So you are looking for a way to convert a url link, presumably to a manufacturers web page that opens in a browser with text and some pictures maybe…magically into a modeled 3D version of whatever item is on that webpage? Or am I missing a step? Maybe I don’t understand this request yet.

SketchUp Pro can import lots of different 3D modeling file formats, but to get 3D data the object needs to have been 3D modeled by someone, somewhere, at some point, in some kind of software.

haha, yea sorry for not being clear. I have components saved. I have a database with info on those components, desc, url links to actual product. images etc. i would like to be able to send a command to import that component into sketchup. I dont have this product built yet, otherwise id provide a visual. And this may not really be a sketchup question but if I have a component, on my local hard drive. This database entry would have the filename and path to this component. could a script then run to import this into sketchup (or any other ideas on how to do so?)

What would be the next step?
Why do you need those components?

You can add a puts statement to the linked code if you want to see a list of all skp files in a directory.

After save_thumbnail, add: puts “skp: #{skp}”

after the designers put together all the pieces for the room then they let me know, i go to that page and assemble the room in sketchup.

What if it doesn’t fit or how will the designers know if it looks the way they wanted it to look?
Sounds like a lot of work and back and forthing.

After you have done their work, what is the purpose of having a SketchUp model within the organization?
To get renders?

Just curious here.

That’s just part of the process… the designers know the dimensions of the space and what needs to be accomplished. They do their best to pick the items that fulfill all of those requirements. Inevitably things will have to be replaced with something that fits better, looks better, fits the budget better. The end goal is to deliver elevations to client to approve and then technical documents to the contractors to build and execute the design plan. Currently we do everything in excel, product selection, budgeting , revisions, to setup the “design” of the rooms. Then I model everything in sketchup and deliver pdf/prints with layout. I’m creating the next version of this as a web application and one portion that i thought would be helpful of would be this catalog of items we have already used/modeled for past projects. It would assist the designers if they wanted to reuse an existing material and it would assist me by having one location for all the things I’ve already modeled and hopefully easier for me to import that item into sketchup.

Im new to the scripting side of sketchup, but my buddy said why dont you just ask chatgpt. So i did: (again this is probably old hat for most of you guys but it worked)

when i pasted that code into the Ruby console the component showed up at the axis origin. I think all i need to do now is create a formula to make the path dynamic and then copy and paste the code into the ruby editor. There must be a way to make this even less intrusive with an even easier way to execute scripts. but for now I have a solution:

Just a visual to show a test entry in the app:

copy the code from that cell and run in the ruby console and it shows up: