sketchucation logo sketchucation
    • Login
    1. Home
    2. Garry K
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    G
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 33
    • Posts 976
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: [Plugin] GKWare Door Maker

      @krisidious said:

      Drag option seems to put drawer on backwards starting from bottom right dragging to top left. all other start points put drawer off to sides.

      There are 3 drag options - All work from bottom left to bottom top.
      The bottom left hand corner of the door / drawer is based on the first point chosen.

      If you bottom right hand corner then top left hand corner then the door will be place backwards as if you are on the other side of the cabinet.

      @krisidious said:

      can I 'select the area' make doors or drawers.

      Ability to select lines while in menu to read entity info.

      I'm not sure what you are asking?

      posted in Plugins
      G
      Garry K
    • RE: [Plugin] GKWare Door Maker

      @guanjin said:

      Activation Tool,No selection dialog。

      Is this SU 2014 and 1.0.19 on Windows??

      posted in Plugins
      G
      Garry K
    • RE: [Plugin] GKWare Door Maker

      @guanjin said:

      1.0.18Not work well in sketcup2014, click on the toolbar icon, you can not open the dialog box.

      You are right - 1.0.18 does not work with SU 2014

      I uploaded version 1.0.19 to Plugin Stores this morning.

      posted in Plugins
      G
      Garry K
    • RE: [News] Ruby 2.0.0 Released

      I don't suppose this means we can use an IDE such as RubyMine and actually perform real debugging!!

      posted in Developers' Forum
      G
      Garry K
    • RE: Get MAC Address

      @tt_su said:

      Well,... since we now have the Ruby Standard Library available: http://ruby-doc.org/stdlib-2.0.0/libdoc/tempfile/rdoc/Tempfile.html

      😄

      So an updated example would be:

      <span class="syntaxdefault"><br />require </span><span class="syntaxstring">'tempfile'<br /></span><span class="syntaxdefault">file </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Tempfile</span><span class="syntaxkeyword">.new(</span><span class="syntaxstring">'my_prefix'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">file</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">close<br /></span><span class="syntaxkeyword">`</span><span class="syntaxstring">ipconfig /all > #{file.path}</span><span class="syntaxkeyword">`<br /></span><span class="syntaxdefault">puts File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">read</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">file</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">path</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">file</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">unlink<br /></span>
      

      This is great for 2014 and forward - but what if you want to support earlier versions.

      I guess we have to either use a one size fits all strategy or check the version an branch appropriately.

      posted in Developers' Forum
      G
      Garry K
    • [Plugin] GKWare Door Maker

      "GKWare Door Maker" is my first plugin to go into the PluginStore.

      Page not found | CabMaker32Page not found – CabMaker32

      favicon

      (cabmaker32.com)

      Please give feedback on language support

      Thanks to unclebim for his cleaning up of the images. Available from his post lower down on this page. The images are smaller and now are seamless.

      Thanks to Igor Sepelev for his help on the Russian translation.
      Thanks to XIAOLONG for providing the Chinese (Simplified) translation - zh_cn.lang
      Thanks to Oxer for providing the Spanish translation - es.lang
      Thanks to Gianni for providing the Italian translation - it.lang
      Thanks to marsahl for providing the German translation - ge.lang

      I have used online translator for French and Chinese (traditional). These 2 translations are in need of help. Hopefully they are only funny in spots and not rude.

      Please open up en.lang as a template in Notepad++ and save as in language that you are translating. Thanks everyone for their technical support.

      To test a translation you need to edit 1 line in defaults.txt. This example forces Door Maker to use french.

      language=fr

      Next version To do list

      Wish List

      1. Pick face(s), bring up Door Maker, configure and convert faces to door or drawer.
        Version 1.0.22

      2. If you drag with "one click" there was a line which was confusing. Fixed.

      3. The stile profile is now a separate moulding and no longer part of the panel.
        This is so that glass and mirror type doors can have the same look.

      4. Added 4 new door shapes for Pro version.

      5. Added 1 new door style for Pro version.

      6. Added “Save as Default” for Pro version.

      7. Added “Add Door Profile” button on tool bar and menu item.

      8. Added “Panel Profile” for Pro version. Users can create custom profiles.

      9. Added “Stile Profile” for Pro version. Users can create custom profiles.

      10. Added “Front Edge Profile” for Pro version. Users can create custom profiles.

      11. Added “Back Edge Profile” for Pro version. Users can create custom profiles.

      12. Added 5 Handle Styles for Pro version. Users can add their own handles.

      13. Added Handle Locations for Pro version.

      14. Added Handle Offset for Pro version.

      15. Added Bottom Rail Width for Pro version.

      16. Added Bottom Panel Height for Pro version.
        Version 1.0.21

      17. Fixed regression bug for “one click”

      18. Now only require vertical wood grain patterns

      19. Wood grain patterns now translated

      20. Added Spanish translation file. es.lang
        Version 1.0.20

      21. Fixed the draging operation. User can now chose any corner and drag to the opposite diagonal corner.

      22. Added config folder. Users should put their edited defaults.txt and or textures.txt files in this folder. They will be preserved with future updates.

      23. Added Chinese(Simplified) language file zh_cn.lang
        Version 1.0.19

      24. This version compatible with SU 2014
        Version 1.0.18

      25. first official release

      posted in Plugins
      G
      Garry K
    • RE: Get MAC Address

      @tt_su said:

      @jaimeda said:

      This works fine in Sketchup 2013 but not in 2014.

      Due to the upgrade of the Ruby core this broke. We haven't been able to figure out why. But the workaround is to pipe the result from the command to a temporary file and read it after executing the command.

      <span class="syntaxdefault"><br />tempfile </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">"C;/Users/Thomas/Desktop/temp.txt"<br /></span><span class="syntaxkeyword">`</span><span class="syntaxstring">ipconfig /all > #{tempfile}</span><span class="syntaxkeyword">`<br /></span><span class="syntaxdefault">puts File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">read</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">tempfile</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> </span>
      

      In my C++ programming for windows I would create a temp file this way

      tempfp = tmpfile();

      Is there anything in Sketchup that would do the same for both Windows and Mac?

      posted in Developers' Forum
      G
      Garry K
    • RE: Curved Staircases

      A user with a windows 8 machine running SU 2013 has reported an error that I can't duplicate ( I don't have a windows 8 machine )

      puts "starting: dialog.execute_script( js_command )"
      dialog.execute_script( js_command )

      this code doesn't run

      puts "finished: dialog.execute_script( js_command )"

      it errors out with this

      type: mismatch
      code: 0
      url: file:///C:/Users/Admin/AppData/Local/Temp/skp8C34.tmp

      Is there anyone else with a Windows 8 machine running 2013 who would be willing to try this code.

      ` require 'sketchup.rb'

      #---------------------------------------

      show_dialog

      #---------------------------------------
      def show_dialog()
      dlg = UI::WebDialog.new( "Stair Measurements", false, "DialogTest", 200, 150, 150, 150, true );
      dlg.add_action_callback( "ruby_callback" ) { |dialog, params|
      text = params.to_s

      	if( text == 'loaded' )
      		args =  'inside_stringer=Housed|Sawtooth|None' +
      				'&inside_stringer=1' +
      				'&inside_option=Has Heel|Has Foot|Both|None' +
      				'&inside_option=3' +
      				'&inside_thickness=60' +
      				'&inside_width=300' +
      				'&inside_rail=Guard Rail|Wall Rail|None' +
      				'&inside_rail=2' +
      				'&outside_stringer=Housed|Sawtooth|None' +
      				'&outside_stringer=0' +
      				'&outside_option=Has Heel|Has Foot|Both|None' +
      				'&outside_option=3' +
      				'&outside_thickness=60' +
      				'&outside_width=400' +
      				'&outside_rail=Guard Rail|Wall Rail|None' +
      				'&outside_rail=2' +
      				'&total_rise=2667' +
      				'&risers=15' +
      				'&riser_thickness=12.7' +
      				'&direction=Clockwise|Anti Clockwise' +
      				'&direction=1' +
      				'&stair_width=1000' +
      				'&radius=2400' +
      				'&degrees=90' +
      				'&floor_thickness=60' +
      				'&rail_style=Classic|Modern|Round|Square|Standard|Traditional' +
      				'&rail_style=4' +
      				'&tread_thickness=38' +
      				'&average_run=254' +
      				'&tread_bullnose=12.7' +
      				'&nosing=25.4' +
      				'&flare_amount=0' +
      				'&progressive_flare=20' +
      				'&flare_count=0'
      
      		js_command = "from_ruby( '" + args + "' )"
      		puts( js_command )
      		puts "starting: dialog.execute_script( js_command )"
      		dialog.execute_script( js_command )
      		puts "finished: dialog.execute_script( js_command )"
      	else
      		UI.messagebox( text )
      		puts( text )
      	end
      

      dialog.close();

        }
        html = <<-HTML
      

      <!DOCTYPE html>
      <html>

      <style type="text/css">
      body { background-color: #F9EBD1}
      fieldset { float: left; background-color: #F9EBD1; border-color: black; margin: 3px;}

      fieldset p {display: table-row;
      font-family: Arial, Helvetica, sans-serif;
      font-size: 90%;
      color: black;
      height: 27px}

      fieldset input,
      fieldset select,
      fieldset label {display: table-cell; margin: 2px; width: 120px }

      fieldset label {text-align: right;}

      fieldset input,
      fieldset select {margin-left: 10px; background-color: wheat;}
      }

      </style>

      <head>
      <meta http-equiv="MSThemeCompatible" content="Yes">
      <script>
      function do_click()
      {
      var items = document.getElementsByTagName( '*' );
      var count = items.length;
      var text = "";

      for ( var i = 0; i < count; i++ )
      {
      if ( items[i].type == "select-one" )
      value = items[i].options[items[i].selectedIndex].value;
      else if ( items[i].type == "text" )
      value = items[i].value;
      else if ( items[i].type == "checkbox" )
      value = items[i].checked.toString();
      else
      value = "";

        if ( value.length > 0 )
        {
      	  if ( text.length > 0 )
      		 text += "&";
      
      	  text += ( items[i].id + "=" + value );
        }
      

      }

      ruby_call( text );
      }
      function from_ruby( data )
      {
      var element;
      var pair;
      var pairs = data.split( '&' );
      var count = pairs.length;

      for ( var i = 0; i < count; i++ )
      {
      	pair = pairs[i].split( '=' );
      
      	element = document.getElementById( pair[0] )
      
      	if ( element.type == "select-one" )
      	{
      		if ( pair[1].indexOf('|') == -1 )
      			element.selectedIndex = pair[1];
      		else
      			populate_drop_down( element, pair[1] );
      	}
      	else if ( element.type == "text" )
      		element.value = pair[1];
      	else if ( element.type == "checkbox" )
      		element.checked = pair[1] == '1';
      }
      

      }
      function populate_drop_down( element, data )
      {
      var options = data.split( '|' );
      var count = options.length;
      var option;

      element.innerHTML = "";
      
      for ( var i = 0; i < count; i++ )
      {
      	option = document.createElement( "option" );
      	option.text = options[i];
      	element.add( option, null );
      }
      

      }
      function ruby_call( text )
      {
      query = 'skp:ruby_callback@' + text;
      window.location.href = query;
      }
      function on_load()
      {
      ruby_call( 'loaded' );
      }
      </script>
      </head>

      <body onload="on_load()">
      <form>

      <fieldset>
      <p><label>Inside Stringer:</label><select id="inside_stringer"></select></p>
      <p><label>Options:</label><select id="inside_option"></select></p>
      <p><label>Thickness:</label><input type="text" id="inside_thickness"</p>
      <p><label>Width:</label><input type="text" id="inside_width"</p>
      <p><label>Rail Options:</label><select id="inside_rail"></select></p>
      </fieldset>

      <fieldset>
      <p><label>Outside Stringer:</label><select id="outside_stringer"></select></p>
      <p><label>Options:</label><select id="outside_option"></select></p>
      <p><label>Thickness:</label><input type="text" id="outside_thickness"</p>
      <p><label>Width:</label><input type="text" id="outside_width"</p>
      <p><label>Rail Options:</label><select id="outside_rail"></select></p>
      </fieldset>

      <fieldset>
      <p><label>Stair Direction:</label><select id="direction"></select></p>
      <p><label>Stair Width:</label><input type="text" id="stair_width"</p>
      <p><label>Radius:</label><input type="text" id="radius"</p>
      <p><label>Degrees:</label><input type="text" id="degrees"</p>
      <p><label>Rail Style:</label><select id="rail_style"></select></p>
      <p><label>Open Risers:</label><input type="checkbox" id="open_riser"</p>
      <p><label>Total Rise:</label><input type="text" id="total_rise"</p>
      <p><label>Risers:</label><input type="text" id="risers"</p>
      <p><label>Riser Thickness:</label><input type="text" id="riser_thickness"</p>
      </fieldset>

      <fieldset>
      <p><label>Tread Thickness:</label><input type="text" id="tread_thickness"</p>
      <p><label>Average Run:</label><input type="text" id="average_run"</p>
      <p><label>Tread Bullnose:</label><input type="text" id="tread_bullnose"</p>
      <p><label>Nosing:</label><input type="text" id="nosing"</p>
      <p><label>Flare Amount:</label><input type="text" id="flare_amount"</p>
      <p><label>Progressive Flare:</label><input type="text" id="progressive_flare"</p>
      <p><label>Flare Count:</label><input type="text" id="flare_count"</p>
      <p><label>Floor Thickness:</label><input type="text" id= "floor_thickness"</p>
      <p><label>Create Stair:</label><input type="button" onclick="do_click()" style="background: silver" value="Ok"></p>
      </fieldset>

      </form>
      </body>
      </html>

        HTML
      
        dlg.set_html html
        dlg.show
      end
      

      if ( not file_loaded?( "dialog_test.rb" ) )
      UI.menu( "Plugins" ).add_item( "Web Dialog Test" ) { show_dialog() }
      file_loaded( "dialog_test.rb" )
      end

      ------------------------------------------------`

      posted in Woodworking
      G
      Garry K
    • RE: Tool usability

      Here is a video on making a bifold door

      posted in Developers' Forum
      G
      Garry K
    • RE: Inputbox too narrow

      I've now made a simple video of the door maker.

      posted in Developers' Forum
      G
      Garry K
    • RE: Between different Macs plugin works and doesn't work

      Jeff,

      I've been reading that Mavericks 10.9 is a free upgrade to Lion 10.8.
      If this is indeed true what is stopping you from upgrading?

      posted in Developers' Forum
      G
      Garry K
    • RE: Between different Macs plugin works and doesn't work

      Steve,

      I'm not sure where to go next. I really don't want to have to load the html page from the server. But then I don't currently know how to do that.

      The hosting company that I use doesn't provide SSL unless I double my yearly payments. It is a WordPress site.

      My StairMaker_service.php is pretty simple. I do use JSON format. Currently I use the following to read the http POST coming from web dialog

      $raw = file_get_contents( "php://input" );
      $json = json_decode( $raw, true );

      // Then I do a bunch of validation, cleaning, testing etc.

      I use echo to send the information back to the web dialog.

      posted in Developers' Forum
      G
      Garry K
    • RE: Curved Staircases

      I now have language translation working. There is a folder called translations and currently there are 4 files in it.

      en.lang - English
      fr.lang - French
      ru.lang - Russian
      zh.lang - Chineses ( traditional )

      Near the top of the defaults.txt file there is a language= section where you can enter the 2 character language code. If you leave the language= blank the system will try to figure out the locale code.

      These language files are straight translations and as a result there might be some funny and or inappropriate translations.

      Anyone interested in helping out with any language translation can get a hold of me.


      French Stair Maker


      Russian Stair Maker


      Chinese Stair Maker

      posted in Woodworking
      G
      Garry K
    • RE: Between different Macs plugin works and doesn't work

      Jeff and Walt

      I have now removed the trailing slash from cabmaker32.com on line 10

      Maybe this will work.
      Please try it


      cleaned up the domain address

      posted in Developers' Forum
      G
      Garry K
    • RE: Between different Macs plugin works and doesn't work

      Just to be sure - you downloaded the latest dialog_test.rb and line 10 now says:
      @dlg.allow_actions_from_host( 'cabmaker32.com/' );

      posted in Developers' Forum
      G
      Garry K
    • RE: Between different Macs plugin works and doesn't work

      Jeff and Walt

      I changed this based on what TIG said.

      Please try it


      modified dialog_test.rb

      posted in Developers' Forum
      G
      Garry K
    • RE: Between different Macs plugin works and doesn't work

      I'm not sure that there is an http error. A value of 0 suggests that the call did not go beyond the computer. This suggests that it is possible that it has something to do with cross-domain requests. However, Sketchup does have the allow_actions_from_host which was set. I thought allow_actions_from_host was specifically for that, in otherwords to reduce security risks by allowing 1 and 1 only external call.

      What we could do is rem out the "loaded" part where we add the listener for DOMContentLoaded and replace that with a button and push the data to a hidden field.

      Then there is but one call back going in one direction. Now if that doesn't work then we have ruled out this being an asynchronous timing thing.

      Any thoughts?

      posted in Developers' Forum
      G
      Garry K
    • RE: Inputbox too narrow

      I've now got it working.
      Here are some examples using the inputbox for my Door Maker.

      My next job will be to get this to work inside web dialog.
      I understand that I will need a metatag - I'm hoping for the best.

      People who actually use these languages will probably laugh at the straight translations. Since I don't understand the various contexts - I'm hoping for a bit of help.

      But at least this is a start - and I know that the code works without having to make any changes.


      English Door Maker


      French Door Maker


      Russian Door Maker


      Chinese Door Maker (traditional)

      posted in Developers' Forum
      G
      Garry K
    • RE: Inputbox too narrow

      I have a number of languages translating just fine.

      I open up my dictionary template in Notepad++ and save it in the appropriate language using UTF-8 without BOM.

      With French, Russian, icelandic everything works well.
      With Chinese I just see a bunch of boxes.

      How can I test - is there something special to make use of Chinese fonts? Do I have to install a Chinese version of Sketchup? Is there something else that I am missing.

      posted in Developers' Forum
      G
      Garry K
    • RE: Inputbox too narrow

      I've got Russian working.

      Initially I ran into a problem where the last item in a list just showed up as a bunch of vertical lines. So I tried adding another pipe symbol at the end and it worked.

      d_options = @@options_t.collect.join('|') + '|'

      Will Chinese work the same way? Or will it not fit into UTF-8?

      posted in Developers' Forum
      G
      Garry K
    • 1 / 1