@ Jim, no i did not get your joke .... Lost in translation I suppose
I've set everything to string now:
<span class="syntaxdefault">require </span><span class="syntaxstring">'sketchup.rb'<br /><br /></span><span class="syntaxcomment">#=============================================================================<br /></span><span class="syntaxdefault"> <br /> <br /> </span><span class="syntaxcomment">#$booleanhelper_scaleoption = 1 # Uncomment the first line of code to scale your object about the origin. ( Restart needed!)<br /></span><span class="syntaxdefault"> <br /> </span><span class="syntaxcomment"># Leave it as it is to scale your object about it's center.<br /></span><span class="syntaxdefault"> <br /><br /><br /><br /><br />module Bhelper<br /><br /> sf </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'100'<br /></span><span class="syntaxdefault"> if Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">read_default</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'liquidsscalefactor'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'value'</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> nil<br /> <br /> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">write_default</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'liquidsscalefactor'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'value'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">sf</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> <br /> end <br /> <br /> <br /> class Tltip<br /> <br /> def initialize</span><span class="syntaxkeyword">()<br /></span><span class="syntaxdefault"> <br /><br /> <br />a </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">read_default</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'liquidsscalefactor'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'value'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'100'</span><span class="syntaxkeyword">)<br /><br /></span><span class="syntaxdefault">if a</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">class </span><span class="syntaxkeyword">==</span><span class="syntaxdefault">String<br />a</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">a</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">to_f<br />else </span><span class="syntaxcomment">### might be an Array or something else!<br /></span><span class="syntaxdefault">a</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">100.0<br />end</span><span class="syntaxcomment">#if<br /><br /><br /><br /></span><span class="syntaxdefault">b </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 1.0</span><span class="syntaxkeyword">/</span><span class="syntaxdefault">a<br />$cmdbooleanhelperscale</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">tooltip </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Scalefactor #{b}"</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> if $cmdbooleanhelperscale<br />$cmdbooleanhelperscale1</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">tooltip </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Scalefactor #{a.to_i}"</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> if $cmdbooleanhelperscale1<br />$cmdbooleanhelperscale</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">menu_text </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Scalefactor #{b}"</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> if $cmdbooleanhelperscale<br />$cmdbooleanhelperscale1</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">menu_text </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Scalefactor #{b}"</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> if $cmdbooleanhelperscale1<br /> end<br /> <br /> end<br /><br /><br />class Getinfo<br /> <br /> def initialize</span><span class="syntaxkeyword">()</span><span class="syntaxdefault"> <br /> <br /> <br /><br /> </span><span class="syntaxkeyword">@@</span><span class="syntaxdefault">sf </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">read_default</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'liquidsscalefactor'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'value'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'100'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> <br /> prompts </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxstring">"Set scalefactor "</span><span class="syntaxkeyword">]<br /></span><span class="syntaxdefault"> <br /> defaults </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[@@</span><span class="syntaxdefault">sf</span><span class="syntaxkeyword">]<br /></span><span class="syntaxdefault"> values </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxstring">"10|100|1000"</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxcomment"># For other scale factors please use the native Sketchup-scale tool . This script is intended only for quick scale up and down actions .<br /><br /></span><span class="syntaxdefault"> <br /> results </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">inputbox prompts</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> defaults</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> values</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Scalefactor."<br /></span><span class="syntaxdefault"> <br /> return if not results<br /><br /> <br /> <br /> </span><span class="syntaxkeyword">@@</span><span class="syntaxdefault">sf </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> results</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">0</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">to_s<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">write_default</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'liquidsscalefactor'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'value'</span><span class="syntaxkeyword">,@@</span><span class="syntaxdefault">sf</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> <br />Bhelper</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Tltip</span><span class="syntaxkeyword">.new()<br /><br /></span><span class="syntaxdefault"> <br /> <br /> end<br /><br />end<br /><br /><br /> <br /><br /><br />class Kleiner<br /> <br /> def initialize</span><span class="syntaxkeyword">()</span><span class="syntaxdefault"> <br /> sf </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">read_default </span><span class="syntaxstring">'liquidsscalefactor'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'value'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'100'</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">to_f<br /> <br /> model </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model<br /> entities </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_entities<br /> selection </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">selection<br /> <br /> boundbox </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">bounds<br /> center</span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> boundbox</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">center<br /><br /> <br /> if $booleanhelper_scaleoption </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> 1<br /> <br /> center </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxdefault">0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> 0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> 0</span><span class="syntaxkeyword">]<br /></span><span class="syntaxdefault"> <br /> <br /> end <br /> <br /> trans </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Geom</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Transformation</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">scaling</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">center</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> 1.0</span><span class="syntaxkeyword">/</span><span class="syntaxdefault">sf</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">transform_entities</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">trans</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> selection</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">to_a</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> <br /> </span><span class="syntaxcomment">#new_view = view.zoom_extents<br /></span><span class="syntaxdefault"> <br /> end<br />end<br /><br /><br /><br /><br /><br />class Groter<br /> <br /> def initialize</span><span class="syntaxkeyword">()</span><span class="syntaxdefault"> <br /> sf </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">read_default </span><span class="syntaxstring">'liquidsscalefactor'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'value'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'100'</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">to_f<br /> <br /> model </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model<br /> entities</span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_entities<br /> selection </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">selection<br /> <br /> <br /> <br /> boundbox </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">bounds<br /> center</span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> boundbox</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">center<br /> <br /> <br /> if $booleanhelper_scaleoption </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> 1<br /> <br /> center </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxdefault">0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> 0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> 0</span><span class="syntaxkeyword">]<br /></span><span class="syntaxdefault"> <br /> <br /> <br /> end<br /><br /> trans </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Geom</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Transformation</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">scaling</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">center</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> sf</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">transform_entities</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">trans</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> selection</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">to_a</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> <br /> </span><span class="syntaxcomment">#new_view = view.zoom_extents<br /></span><span class="syntaxdefault"> <br /> end<br />end<br /><br /><br /> <br /> <br /> <br /> <br /><br /></span><span class="syntaxcomment">#=============================================================================<br /></span><span class="syntaxkeyword">if(</span><span class="syntaxdefault"> not $booleanhelper_menu_loaded </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> <br /> <br /> add_separator_to_menu</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Plugins"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> new_menu </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">menu</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Plugins"</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">add_submenu</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Boolean helper"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> new_toolbar </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Toolbar</span><span class="syntaxkeyword">.new(</span><span class="syntaxstring">"Boolean helper"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> plugins </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">find_support_file</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Plugins"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> imgdir </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">join</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">plugins</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Booleanhelper"</span><span class="syntaxkeyword">)<br /><br /></span><span class="syntaxdefault"> $cmdbooleanhelperscale </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Command</span><span class="syntaxkeyword">.new(</span><span class="syntaxstring">"Scale down"</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">{</span><span class="syntaxdefault">Bhelper</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Kleiner</span><span class="syntaxkeyword">.new()</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault"> $cmdbooleanhelperscale</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">small_icon </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">join</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">imgdir</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"smaller.png"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> $cmdbooleanhelperscale</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">large_icon </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">join</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">imgdir</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"smallerL.png"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> <br /> <br /><br /> new_menu</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_item</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$cmdbooleanhelperscale</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> new_toolbar</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_item</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$cmdbooleanhelperscale</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> <br /> $cmdbooleanhelperscale1</span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Command</span><span class="syntaxkeyword">.new(</span><span class="syntaxstring">"Scale up"</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">{</span><span class="syntaxdefault">Bhelper</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Groter</span><span class="syntaxkeyword">.new()</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault"> $cmdbooleanhelperscale1</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">small_icon </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">join</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">imgdir</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"bigger.png"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> $cmdbooleanhelperscale1</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">large_icon </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">join</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">imgdir</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"biggerL.png"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> <br /><br /><br /> new_menu</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_item</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$cmdbooleanhelperscale1</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> new_toolbar</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_item</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$cmdbooleanhelperscale1</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> <br /> cmd </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Command</span><span class="syntaxkeyword">.new(</span><span class="syntaxstring">"set scale factor"</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">{</span><span class="syntaxdefault">Bhelper</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Getinfo</span><span class="syntaxkeyword">.new()}<br /></span><span class="syntaxdefault"> <br /> new_menu</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_item</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">cmd</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> new_toolbar</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">show<br />Bhelper</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Tltip</span><span class="syntaxkeyword">.new()<br /></span><span class="syntaxdefault"> $booleanhelper_menu_loaded </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> true<br />end <br /><br />end </span><span class="syntaxcomment">#module<br /><br /></span><span class="syntaxdefault"> </span>
Is it correct like this??