Learn to search the forum using the menu icon (at upper right. )
You’d find this topic where I answered this question 2 years ago …
For brevity in reading this thread, I’ll post some of that example code
with the 3DW url changes specific to this topic:
mod = Sketchup::active_model
url = "https://3dwarehouse.sketchup.com/model/8b897767f783df7c7bb6b7c16e3a2cab/Router-D-link"
cdef = mod.definitions.load_from_url(url)
return unless cdef # good practice
# could be "next unless cdef" inside a loop
point = Geom::Point3d::new( 10, 10, 0 )
cinst = mod.active_entities.add_instance(
Geom::Transformation::new( point )
NOTE: The above example URL is not the actual working URL. (This is the link to the model’s 3DW page.) The real links can be found by clicking the “Download” button. The actual URLs have a SKP version parameter in them.
Coders should read the documentation for the
Sketchup::DefinitionList#load_from_url method, and the explanation of how to write an abstract
LoadHandler class for this method.