Sign in

SketchUp Help



Embedding a model from the 3D Warehouse in a web site or blog

Print
You can embed any of our 3D Warehouse models in a Website or Blog. To Embed a model in a Website or blog:
  1. Visit a model's details page.
  2. Click on the Include button. A snippet of HTML appears.
  3. Click on the Image or 3D View radio button. These buttons determine whether the model will appear as a 2D image (Image) or 3D model (3D View) on your web page. These radio buttons actually alter the etype (embed type) variable in the HTML snippet (im = Image and sw = 3D swivel view). An example HTML snippet, with the etype set to im follows:

    <iframe src='http://sketchup.google.com/3dwarehouse/mini?mid=5368e94d006f71f1ae682533f3f1d4dd&etyp=im&width=400&height=300' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' width='400' height='300'></iframe>

  4. Cut and paste the HTML into your web page's HTML to display the model.
Changing the size

You must change the height and width parameters in both places they appear in the HTML snippet to change height and width. An example HTML snippet with width and height changed to 600 and 700 follows:

<iframe src='http://sketchup.google.com/3dwarehouse/mini?mid=5368e94d006f71f1ae682533f3f1d4dd&etyp=im&width=600&height=700' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' width='600' height='700'></iframe>

Embedding a model with Google Earth plug-in

The Google Earth plug-in allows you to display Google Earth within the context of your web site. You can also display a model within the Google Earth plug-in by changing the etyp to ge. An example HTML snippet for displaying a model in Google Earth plug-in follows:

<iframe src='http://sketchup.google.com/3dwarehouse/mini?mid=b04d228d93a01e07b84c98d39901e6ed&etyp=ge&width=600&height=700' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' width='600' height='700'></iframe>

Checking for the Google Earth plug-in
Your web site should also check to ensure the Google Earth plug-in is installed. Following is a snippet of javascript used to determine if the Google Earth plug-in is installed (this javascript would come before the HTML snippet to display the model):

<html>
   <body>
     <script type="text/javascript" src="http://www.google.com/jsapi?key=ABCDEFG"> </script>
     <script type="text/javascript">google.load("earth", "1");</script>
     <iframe id='3dwh-embed' src='' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' width='400' height='300'></iframe>
     <script>
       var url = 'http://sketchup.google.com/3dwarehouse/mini?mid=b04d228d93a01e07b84c98d39901e6ed&width=400&height=300'
       url += google.earth.isInstalled() ? '&etyp=ge' : '&etyp=sw';
       document.getElementById('3dwh-embed').src = url;
     </script>
   </body>
</html>

Note: Read the Terms of Service for using models from the 3D Warehouse on your web site or blog.

updated 2/8/2010

Was this information helpful?

Help resources

Create 3D buildings online

More info