Scale lib (title must be more than 10 characters bla bla bla)

Hi all,

I’ve just published a small little library for handing scales in SketchUp. It is basically a rewrite of what I’ve used myself in my View Scale plugin. This class can parse a scale from a single string in various formats, such as “1:100”, “10%” or “1”=4’", with no need to split nominator and denominator in separate fields.

2019-11-02_14h57_34

@guy, I haven’t used Skalp for some time and not remember the UI, but maybe this is useful for you and Joeren.

@SketchupDoug, I’d love if something like this was implemented in LayOut. The scale dropdown is very noisy and I have to squeeze my eyes to filter out any useful info in it, when it would be much faster to just type 1:100 straight into the field.

The dropdown can still be there for those not knowing how scales work, and for custom scales, in my case typically handling the foreshortening in isometric drawings, but the field also accepting text input would be a significant workflow improvement. What’s ironic is that the scale field actually is a text field, but it doesn’t seem to respond to typing other than playing the error ding sound.

2019-11-02_15h03_07_noise_outlined

4 Likes

Library would have passed the 10 character limit with a lot less blah blahing. :grin:
Not to mention small little is an excellent example of tautology. :upside_down_face:

1 Like

I though about that but lib is very commonly used for software libraries. The View Lib I made the other week is an example of a small lib, or maybe little one. And this one is just fraction of the size of that one :stuck_out_tongue: .

2 Likes

The scale parsing code has now been cleaned up a bit. Previously, as a side effect of supporting both 1%, 1:100 and 1" = 4m, you could enter “composite” scales such as “1:4m” or “5m:4%”. Now the code branches for parsing these various formats, and a scale must be in one of the valid formats to be parsed.

@SketchupDoug, I’d like to extend my FR to include the Print dialog in SketchUp. Setting up scaling as 2 text fields and 2 dropdowns is just really awkward when it could be just a single text field.

With SketchUp’s length parsing available it takes just about 12 liens of code to parse various scale formats to scaling factors, such as 0.1, 0,1, 10%, 1:10, 1"=10".