SlideShare a Scribd company logo
1 of 14
Download to read offline
Advanced Ruby Scripting
for SketchUp
Scott Lininger
May 29, 2008
What’s SketchUp?

  Google’s 3D drawing tool
  Used and loved by design professionals and hobbyists
  Easy to learn yet powerful
  Free and Pro versions are available


On the Nerdy Side…
  Client application for PC & Mac
  Written in C++ and Objective C
  OpenGL for display layer
  Has a Ruby programming API
How Do I Get to the API?

  If you have SU, you have the API
  You write a Ruby Script
  Put your script into /SketchUp 6/Plugins folder and restart
  SU
  Control SketchUp via a powerful, consistent Object model

     Sketchup.active_model.camera.eye.x


         entities[0].transform! by_some_amount


  edge.faces[0].material = some_color
WebDialogs

  WebDialogs provide an embedded browser inside
  SketchUp
     Internet Explorer on PC
     Webkit/Safari on Mac
Ruby Extension Modules

  Extend Ruby with native code binary (aka extension
  module)
  Better performance
  Better IP protection of your code
Advanced Technique 1:
Grab and Render Web Data

  Ruby Opens a Webdialog to some webpage
  The page uses AJAX or other techniques to pull data
     TIP: If your webpage is local, you can get data across
     domains
  JS calls a ruby method and sends down that data to
  SketchUp as a string


                        Stock Grabber
             Demo
                         + Footprinter
Advanced Technique 2:
Hide the Web Dialog

   Provides a “permanent” Javascript environment
   Javascript can take control at any time
   How to do it on the PC?

   my_dialog.show()
   my_dialog.set_position(9999,9999)



   On the Mac?
                                                  Secret
      Just don’t call .show() method   Demo   Stock Grabber
Advanced Technique 3:
Use WebDialogs + Ruby to Control the Camera

   Move the camera to control user experience
   Export 2D screenshots to get web-friendly output from SU



       Demo         3D Exporter



   http://sketchup.google.com/download/plugins.html
      3D Exporter is an open source project! Please contribute.
Advanced Technique 4:
Animate using Javascript’s setTimeout

   Create a timer in Javascript…
   timerID = setTimeout(quot;nextFrame()quot;, 500)


   It runs in the browser’s thread (not SketchUp’s)
   Quietly sends commands to Ruby to create animation.



            Demo       Spin My Yoda
Advanced Technique 5:
Capture Key Strokes with Javascript

   document.onClick can capture keystrokes
   dialog.show_modal() can force focus to your dialog
   Interesting way of adding keyboard support to SketchUp




           Demo      Nudge My Yoda
Advanced Technique 6:
Bring ‘em all together

   JS + Ruby Games in SketchUp




                            Prince IO
          Dem            The SketchUp Knight
           o
Advanced Technique 7:
Ruby Extension Modules

  Take these animation and processing techniques to
  the next level
  SketchyPhysics is a great example… numerous demos on
  YouTube
Learn More


  Get SketchUp
  http://sketchup.google.com
  API Documentation
  http://code.google.com/apis/sketchup/
  Join the SketchUp API Blog
  http://sketchupapi.blogspot.com/
  Join the Ruby User Group
  http://groups.google.com/group/Ruby-API
Advanced Ruby Scripting for SketchUp

More Related Content

Viewers also liked

Portfolio Presentation
Portfolio PresentationPortfolio Presentation
Portfolio Presentationjeffnissen
 
Solo Latin Tango Prat
Solo Latin Tango PratSolo Latin Tango Prat
Solo Latin Tango PratHOME
 
April Vacation
April VacationApril Vacation
April VacationDBrandon69
 
Bruno
BrunoBruno
BrunoHOME
 
廖上鈿
廖上鈿廖上鈿
廖上鈿nice567
 
Abb Tech Conference Program
Abb Tech Conference ProgramAbb Tech Conference Program
Abb Tech Conference Programrwaldo
 
Founders guild epiphany
Founders guild epiphanyFounders guild epiphany
Founders guild epiphanySteve Newcomb
 
Isurus Sales Effectiveness Analysis Overview
Isurus Sales Effectiveness Analysis OverviewIsurus Sales Effectiveness Analysis Overview
Isurus Sales Effectiveness Analysis OverviewRadwich
 
Boozefish Campaign
Boozefish CampaignBoozefish Campaign
Boozefish Campaignjeffnissen
 
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...GoogleTecTalks
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To AndroidGoogleTecTalks
 
Isurus Market Opportunity Analysis Overview
Isurus Market Opportunity Analysis OverviewIsurus Market Opportunity Analysis Overview
Isurus Market Opportunity Analysis OverviewRadwich
 
FRE 6431s Project
FRE 6431s ProjectFRE 6431s Project
FRE 6431s Projectmalshetwey
 
Vanessa Mae Happy Valley Violin T
Vanessa Mae Happy Valley Violin TVanessa Mae Happy Valley Violin T
Vanessa Mae Happy Valley Violin THOME
 
Save Your Client\'s Money With MSA
Save Your Client\'s Money With MSASave Your Client\'s Money With MSA
Save Your Client\'s Money With MSAbigfaz2009
 

Viewers also liked (20)

Planta Poder
Planta PoderPlanta Poder
Planta Poder
 
Portfolio Presentation
Portfolio PresentationPortfolio Presentation
Portfolio Presentation
 
Solo Latin Tango Prat
Solo Latin Tango PratSolo Latin Tango Prat
Solo Latin Tango Prat
 
April Vacation
April VacationApril Vacation
April Vacation
 
Bruno
BrunoBruno
Bruno
 
廖上鈿
廖上鈿廖上鈿
廖上鈿
 
Make moda final
Make moda finalMake moda final
Make moda final
 
Abb Tech Conference Program
Abb Tech Conference ProgramAbb Tech Conference Program
Abb Tech Conference Program
 
123
123123
123
 
Founders guild epiphany
Founders guild epiphanyFounders guild epiphany
Founders guild epiphany
 
Isurus Sales Effectiveness Analysis Overview
Isurus Sales Effectiveness Analysis OverviewIsurus Sales Effectiveness Analysis Overview
Isurus Sales Effectiveness Analysis Overview
 
Planta Poder
Planta PoderPlanta Poder
Planta Poder
 
Boozefish Campaign
Boozefish CampaignBoozefish Campaign
Boozefish Campaign
 
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Isurus Market Opportunity Analysis Overview
Isurus Market Opportunity Analysis OverviewIsurus Market Opportunity Analysis Overview
Isurus Market Opportunity Analysis Overview
 
FRE 6431s Project
FRE 6431s ProjectFRE 6431s Project
FRE 6431s Project
 
Tcom Maint Operate
Tcom Maint OperateTcom Maint Operate
Tcom Maint Operate
 
Vanessa Mae Happy Valley Violin T
Vanessa Mae Happy Valley Violin TVanessa Mae Happy Valley Violin T
Vanessa Mae Happy Valley Violin T
 
Save Your Client\'s Money With MSA
Save Your Client\'s Money With MSASave Your Client\'s Money With MSA
Save Your Client\'s Money With MSA
 

Similar to Advanced Ruby Scripting for SketchUp

2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkitCocoaHeads Tricity
 
LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK
LUMIA APP LAB #15: USING THE NOKIA IMAGING SDKLUMIA APP LAB #15: USING THE NOKIA IMAGING SDK
LUMIA APP LAB #15: USING THE NOKIA IMAGING SDKMicrosoft Mobile Developer
 
Html5 Game Development with Canvas
Html5 Game Development with CanvasHtml5 Game Development with Canvas
Html5 Game Development with CanvasPham Huy Tung
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Raymond Camden
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.JooinK
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWTFrancesca Tosi
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1benDesigning
 
DCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application PackagesDCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application PackagesDocker, Inc.
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptKevin Read
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Kevin Read
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esdavrous
 
Adobe premiere pro brochure
Adobe premiere pro   brochureAdobe premiere pro   brochure
Adobe premiere pro brochureZabeel Institute
 
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 RICOH THETA x IoT Developers Contest : Cloud API Seminar RICOH THETA x IoT Developers Contest : Cloud API Seminar
RICOH THETA x IoT Developers Contest : Cloud API Seminarcontest-theta360
 
HoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOpsHoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOpsSarah Sexton
 
Grails beginners workshop
Grails beginners workshopGrails beginners workshop
Grails beginners workshopJacobAae
 
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textToma Velev
 
Om Pawar MP AJP.docx
Om Pawar MP AJP.docxOm Pawar MP AJP.docx
Om Pawar MP AJP.docxOmpawar61
 
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SKJavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SKDavid Wesst
 

Similar to Advanced Ruby Scripting for SketchUp (20)

2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit
 
Swt 2009
Swt 2009Swt 2009
Swt 2009
 
LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK
LUMIA APP LAB #15: USING THE NOKIA IMAGING SDKLUMIA APP LAB #15: USING THE NOKIA IMAGING SDK
LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK
 
Html5 Game Development with Canvas
Html5 Game Development with CanvasHtml5 Game Development with Canvas
Html5 Game Development with Canvas
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1
 
DCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application PackagesDCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application Packages
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScript
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
 
Adobe premiere pro brochure
Adobe premiere pro   brochureAdobe premiere pro   brochure
Adobe premiere pro brochure
 
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 RICOH THETA x IoT Developers Contest : Cloud API Seminar RICOH THETA x IoT Developers Contest : Cloud API Seminar
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 
HoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOpsHoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOps
 
3d web
3d web3d web
3d web
 
Grails beginners workshop
Grails beginners workshopGrails beginners workshop
Grails beginners workshop
 
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - text
 
Om Pawar MP AJP.docx
Om Pawar MP AJP.docxOm Pawar MP AJP.docx
Om Pawar MP AJP.docx
 
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SKJavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
 

More from GoogleTecTalks

Web Hooks And The Programmable World Of Tomorrow
Web Hooks And The Programmable World Of TomorrowWeb Hooks And The Programmable World Of Tomorrow
Web Hooks And The Programmable World Of TomorrowGoogleTecTalks
 
Using The Google Collections Library For Java
Using The Google Collections Library For JavaUsing The Google Collections Library For Java
Using The Google Collections Library For JavaGoogleTecTalks
 
Voice Browsing And Multimodal Interaction In 2009
Voice Browsing And Multimodal Interaction In 2009Voice Browsing And Multimodal Interaction In 2009
Voice Browsing And Multimodal Interaction In 2009GoogleTecTalks
 
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...GoogleTecTalks
 
New Media Mavericks Will The Revolution Be Spidered
New Media Mavericks Will The Revolution Be SpideredNew Media Mavericks Will The Revolution Be Spidered
New Media Mavericks Will The Revolution Be SpideredGoogleTecTalks
 
Performance Improvements In Browsers
Performance Improvements In BrowsersPerformance Improvements In Browsers
Performance Improvements In BrowsersGoogleTecTalks
 
Black Cloud Patterns Toward The Future
Black Cloud Patterns Toward The FutureBlack Cloud Patterns Toward The Future
Black Cloud Patterns Toward The FutureGoogleTecTalks
 
Advanced Gadget And Ui Development Using Googles Ajax Ap Is
Advanced Gadget And Ui Development Using Googles Ajax Ap IsAdvanced Gadget And Ui Development Using Googles Ajax Ap Is
Advanced Gadget And Ui Development Using Googles Ajax Ap IsGoogleTecTalks
 
A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script En...
A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script En...A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script En...
A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script En...GoogleTecTalks
 
Keynote Client Connectivity And The Cloud
Keynote Client Connectivity And The CloudKeynote Client Connectivity And The Cloud
Keynote Client Connectivity And The CloudGoogleTecTalks
 

More from GoogleTecTalks (11)

Web Hooks And The Programmable World Of Tomorrow
Web Hooks And The Programmable World Of TomorrowWeb Hooks And The Programmable World Of Tomorrow
Web Hooks And The Programmable World Of Tomorrow
 
Using The Google Collections Library For Java
Using The Google Collections Library For JavaUsing The Google Collections Library For Java
Using The Google Collections Library For Java
 
Voice Browsing And Multimodal Interaction In 2009
Voice Browsing And Multimodal Interaction In 2009Voice Browsing And Multimodal Interaction In 2009
Voice Browsing And Multimodal Interaction In 2009
 
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
 
New Media Mavericks Will The Revolution Be Spidered
New Media Mavericks Will The Revolution Be SpideredNew Media Mavericks Will The Revolution Be Spidered
New Media Mavericks Will The Revolution Be Spidered
 
Performance Improvements In Browsers
Performance Improvements In BrowsersPerformance Improvements In Browsers
Performance Improvements In Browsers
 
Black Cloud Patterns Toward The Future
Black Cloud Patterns Toward The FutureBlack Cloud Patterns Toward The Future
Black Cloud Patterns Toward The Future
 
Advanced Gadget And Ui Development Using Googles Ajax Ap Is
Advanced Gadget And Ui Development Using Googles Ajax Ap IsAdvanced Gadget And Ui Development Using Googles Ajax Ap Is
Advanced Gadget And Ui Development Using Googles Ajax Ap Is
 
Advanced Kml
Advanced KmlAdvanced Kml
Advanced Kml
 
A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script En...
A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script En...A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script En...
A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script En...
 
Keynote Client Connectivity And The Cloud
Keynote Client Connectivity And The CloudKeynote Client Connectivity And The Cloud
Keynote Client Connectivity And The Cloud
 

Recently uploaded

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Recently uploaded (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Advanced Ruby Scripting for SketchUp

  • 1. Advanced Ruby Scripting for SketchUp Scott Lininger May 29, 2008
  • 2. What’s SketchUp? Google’s 3D drawing tool Used and loved by design professionals and hobbyists Easy to learn yet powerful Free and Pro versions are available On the Nerdy Side… Client application for PC & Mac Written in C++ and Objective C OpenGL for display layer Has a Ruby programming API
  • 3. How Do I Get to the API? If you have SU, you have the API You write a Ruby Script Put your script into /SketchUp 6/Plugins folder and restart SU Control SketchUp via a powerful, consistent Object model Sketchup.active_model.camera.eye.x entities[0].transform! by_some_amount edge.faces[0].material = some_color
  • 4. WebDialogs WebDialogs provide an embedded browser inside SketchUp Internet Explorer on PC Webkit/Safari on Mac
  • 5. Ruby Extension Modules Extend Ruby with native code binary (aka extension module) Better performance Better IP protection of your code
  • 6. Advanced Technique 1: Grab and Render Web Data Ruby Opens a Webdialog to some webpage The page uses AJAX or other techniques to pull data TIP: If your webpage is local, you can get data across domains JS calls a ruby method and sends down that data to SketchUp as a string Stock Grabber Demo + Footprinter
  • 7. Advanced Technique 2: Hide the Web Dialog Provides a “permanent” Javascript environment Javascript can take control at any time How to do it on the PC? my_dialog.show() my_dialog.set_position(9999,9999) On the Mac? Secret Just don’t call .show() method Demo Stock Grabber
  • 8. Advanced Technique 3: Use WebDialogs + Ruby to Control the Camera Move the camera to control user experience Export 2D screenshots to get web-friendly output from SU Demo 3D Exporter http://sketchup.google.com/download/plugins.html 3D Exporter is an open source project! Please contribute.
  • 9. Advanced Technique 4: Animate using Javascript’s setTimeout Create a timer in Javascript… timerID = setTimeout(quot;nextFrame()quot;, 500) It runs in the browser’s thread (not SketchUp’s) Quietly sends commands to Ruby to create animation. Demo Spin My Yoda
  • 10. Advanced Technique 5: Capture Key Strokes with Javascript document.onClick can capture keystrokes dialog.show_modal() can force focus to your dialog Interesting way of adding keyboard support to SketchUp Demo Nudge My Yoda
  • 11. Advanced Technique 6: Bring ‘em all together JS + Ruby Games in SketchUp Prince IO Dem The SketchUp Knight o
  • 12. Advanced Technique 7: Ruby Extension Modules Take these animation and processing techniques to the next level SketchyPhysics is a great example… numerous demos on YouTube
  • 13. Learn More Get SketchUp http://sketchup.google.com API Documentation http://code.google.com/apis/sketchup/ Join the SketchUp API Blog http://sketchupapi.blogspot.com/ Join the Ruby User Group http://groups.google.com/group/Ruby-API