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 Sketch Up

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 Sketch Up

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 Sketch Up (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

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 

Recently uploaded (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Advanced Ruby Scripting For Sketch Up

  • 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