[Plugin] Dynamic Snap

[Plugin] Dynamic Snap

Postby mattritzman » Sat Aug 22, 2009 7:18 am

This plug-in changes the snap distance depending on how zoomed in you happen to be.

"Why on earth would you want to do that?" you ask. Well, you see I've got a tabletPC (it is way fun), and I'm trying to use the pen as much as possible (gmote is a must!*). It turns out, while using the pen, I can't use the value control box efficiently. So I turned to the snaps. They help, but it is a pain to change them by hand. After a bit of dabbling in Ruby I came up with this solution.

There are a ton of things that could be done to this script to make it more functional. It currently works only for inches, it could be activated by a button, it could be better integrated into the interface. I don't know if I'll get around to any of them, but you are welcome to do anything you want to it. It is about a 2 on the simplicity scale.

Please note, this is my first post-able Ruby, so all possible disclaimers apply.

--Matt
* http://www.handform.net/gmote.php
http://forums.sketchucation.com/viewtopic.php?f=15&t=14116&p=106316
p.s. Thanks Chris for your excellent tutorial.

Updated (8/22/09): Call manager and provider by name.
0
Last edited by mattritzman on Sat Aug 22, 2009 4:22 pm, edited 1 time in total.

mattritzman 
 

Re: [Plugin] Dynamic Snap

Postby Jim » Sat Aug 22, 2009 3:10 pm

Matt,

I don't have a tablet, but your solution sounds like it could useful for everyone. A dynamic grid, in a way.
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] Dynamic Snap

Postby Jim » Sat Aug 22, 2009 3:22 pm

Matt,

I found that I had to change this: provider = manager[0] to this: provider = manager['UnitsOptions'] in order for it to work on my machine.

Should probably do the same with the provider['LengthSnapLength'] statement.

Apparently, the order that the options providers are returned is not concrete.
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] Dynamic Snap

Postby mattritzman » Sat Aug 22, 2009 4:24 pm

Thanks, Jim. I made the changes and reposted it. Dynamic Grid would have been a better name.
0

mattritzman 
 

Re: [Plugin] Dynamic Snap

Postby Chris Fullmer » Mon Aug 24, 2009 6:23 am

Hey Matt, good to see you around here, and publishing a script! Glad you got it done, found a little time to learn some Ruby then I guess? :)

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Dynamic Snap

Postby solarepiphany » Mon Aug 24, 2009 10:19 pm

Any chance you can share your tablet specs Matt? I've been looking for one with good SU capabilities for some time now!

Thanks
0

solarepiphany 
 

Re: [Plugin] Dynamic Snap

Postby mitcorb » Mon Aug 24, 2009 11:58 pm

I would be interested in this plugin since I have a tablet pc, also. But, I think I will need to observe its progress for a while.
0
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb 
Top SketchUcator
 

Re: [Plugin] Dynamic Snap

Postby mattritzman » Tue Aug 25, 2009 5:28 pm

@ Chris, just scratching the surface. Even with the tiny bit I've learned it is quite empowering.

@ solarepiphany,
HP TouchSmart tx2
AMD Turion X2 Dual Core 2.1 GHz
4 GB RAM
64-bit

Check out the reviews. It is a bit heavy for a tablet (4lb). It runs a bit hot. The battery life could be much better. It could be a bit sturdier. It also came with a ton of bloatware.

But I like it a lot. So far, it does what I want it to do.
0

mattritzman 
 

Re: [Plugin] Dynamic Snap

Postby mattritzman » Tue Aug 25, 2009 5:30 pm

@ mitcorb,
You are welcome to add to it and improve it.
0

mattritzman 
 

Re: [Plugin] Dynamic Snap

Postby mitcorb » Tue Aug 25, 2009 11:51 pm

Hi, matt:
Sorry, I have not learned the Ruby language yet.
I can certainly download and test out the plugin and give you my observations from a layman's point of view on this tablet. I wouldn't say that this unit would be recommended, considering the age. I just inserted the specs below for your information.

By the way, I am transcribing on my tablet right now.
Motion Computing LE1600, an older model slate style with attachable keyboard/dock. I also use a wireless mouse. It helps to be ambidextrous.
1.50 gigahertz Intel Pentium M
64 kilobyte primary memory cache
2048 kilobyte secondary memory cache
Bus Clock: 100 megahertz
BIOS: Motion Computing - LE1600 A12 12/19/2006
Drives Memory Modules 1526 Megabytes Installed Memory (maxed out).
Slot 'DIMM A' has 512 MB
Slot 'DIMM B' has 1024 MB
60.01 Gigabytes Usable Hard Drive Capacity
37.11 Gigabytes Hard Drive Free Space
Dual Toshiba Li-Ion batteries for approx. 5 hours mobile time in real life, (claimed up to 8 hours).
Mobile Intel(R) 915GM/GMS,910GML Express Chipset Family [Display adapter] (2x)
Digital Flat Panel (1024x768) [Monitor]
The screen is actually a Wacom product laundered, I mean licensed out either to Toshiba or direct to Motion.

This unit came with Alias Sketchbook Pro(bought out and thrown on a shelf by Autodesk). That is still fun, when I can get to it.
0
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb 
Top SketchUcator
 

Re: [Plugin] Dynamic Snap

Postby mattritzman » Wed Aug 26, 2009 4:05 pm

Mitcorb,
That's a real classic. I remember dreaming about those specs when it first came out.

Sketchbook is still awesome! Autodesk hasn't ruined it yet.
0

mattritzman 
 

Re: [Plugin] Dynamic Snap

Postby mitcorb » Wed Aug 26, 2009 8:36 pm

Hi, Matt: I have loaded the plugin. However, cannot see any hint of the script in the menus. Should I operate it from the console? Should I see any command in the menus, or the right click context?
I am probably doing something wrong.
Lemme know.
mitcorb

by the way, loaded it on both the tablet and my desktop with no clues.
0
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb 
Top SketchUcator
 

Re: [Plugin] Dynamic Snap

Postby mattritzman » Wed Aug 26, 2009 9:58 pm

Currently, it just starts when you start SketchUp (if it is in your plugin path). I haven't put together an interface; I'm waiting for C.Fullmer's next tutorial before tackling that ;)

Create a rectangle or draw a line, and watch the VCB. It should snap to whole numbers (unless you are zoomed in really close).

The script will give strange results if your units are set to anything but inches :(
0

mattritzman 
 

Re: [Plugin] Dynamic Snap

Postby matteo » Thu Aug 27, 2009 12:06 am

hi Matt, and thank you for this plugin.
That's a very smart idea. :enlight:

If you don't mind, I've converted the values so that it works with metric units: my experience with ruby programming is zero, I've just converetd inches into centimeters, after a bit of tweaking. ;)

What I understand is that sketchup's internal engine works in inches, even if the length is displayed in meters or centimeters.
Please correct me if I made some mistakes. :oops:


/matteo
0

matteo 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: Bing [Bot], daaniisan, jonorman and 5 guests

Visit our sponsors: