What’s New in SketchUp 7
November 13th, 2008 | Published in Google SketchUp
SketchUp 7 contains several improvements to the Ruby API. Here's a quick tour of the best changes.
-
Improve your script's performance!
Ability to perform faster inside start_operation transactions.
go_faster = true
model.start_operation operation_name, go_faster
Results from some real world tests, once the go_faster boolean was added:
Intersect overlaps with 500 overlapping squares
28.4 seconds vs. 26.3 (~92% as long)
Make faces with 500 faceless cubes
21.7 seconds vs. 14.5 (~66% as long)
Windowizer 3.0 with Four 20'x20' windows, 12x12
16.1 seconds vs. 7.0 seconds (~43% as as long)
Windowizer 4.0 with Ten 5'x5' windows, 6x6
22.6 seconds vs 8.7 seconds (~38% as long)
-
Leverage improved Web Dialogs
Addition of min/max widths.
WebDialog.min_width=100
WebDialog.max_width=300
WebDialog.min_height=500
WebDialog.max_height=600
Fixed Mac support for WebDialogs execute_script
WebDialog.execute_script('alert("Bug is Fixed!")');
New full_security mode for webdialogs (disables plugins and remote links)
WebDialog.set_full_security
Ability to hide home/next/back navigation icons on the Mac
WebDialog.navigation_buttons_enabled=true
Cleaner, hash-based syntax for initializing
my_dialog = WebDialog.new(my_settings_hash)
-
Control Scale Tool handles on your components
Your script can now control which scale tool handles appear
# Disable the green and red-axes handles
# by setting bits 1 and 2 to 1.
behavior = my_component_definition.behavior
behavior.no_scale_mask = (1 2)
-
Load Definitions from the Web, or save to disk
Ability to download a definition from URL
model.definitions.load_from_url(url, download_handler)
Ability to Save components to disk from the API
my_definition.save_as(path)
-
Know more about what your users are doing
New methods for detecting "Component Edit" mode
users_current_edit = model.active_path
edit_mode_transform = model.edit_transform
Easily determine if they're running in licensed Pro
is_licensed_pro = Sketchup.is_pro?
New "model level" callbacks in ModelObserver
def onActivePathChanged(model) { # Detect edit mode }
def onPlaceComponent(instance) { # Detect placements }
def onExplode(model) { # Detect group/component explode }
def onBeforeComponentSaveAs(instance) { # Add data on save as }
def onAfterComponentSaveAs(instance) { # Then clean up }
Detect if they've turned off your extension via the AppObserver
def onUnloadExtension(extension_name)
-
Delete your scenes via the API
my_page.erase
-
Keep SketchUp in Synch
UI.refresh_inspectors # force complete UI update
my_definition.refresh_thumbnail # force thumb update
my_definition.invalidate_bounds # force bb update
-
Measure your groups regardless of their transform
untransformed_bb = my_group.local_bounds
-
Use middle mouse button in your custom tools
def onMButtonDown(flags, x, y, view) { # now works! }
def onMButtonUp(flags, x, y, view) { # now works! }
-
Send ruby console output to the standard out
If you start up SketchUp from the command line, you can pipe to standard error and see ruby puts statements appear for you.
Sketchup.exe > myRubyLog.txt
-
and your users will benefit from numerous stability fixes!
Detailed documentation is coming soon... stay tuned!