1. Hey guyz. Welcome to the All New Phlatforum!



    Sign Up and take a look around. There are so many awesome new features.

    The Phlatforum is a place we can all hang out and

    have fun sharing our RC adventures!

  2. Dismiss Notice

Anyone know Ruby who can help me mod SketchUcam?

Discussion in 'SketchUcam Help' started by ElkaderLight, Aug 12, 2013.

  1. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    well, I just did a fresh install of Sketchup Make onto my laptop. opened Sketchup, messed with toolbars a bit, selected the 'product design and woodworking' template, closed it. all fine. installed from the RBZ, close Sketchup , open Sketchup, all SketchUcam stuff good to go.
    close sketchup, copy MyConstants-example.rb to MyConstants.rb
    open sketchup, all good, expected values present.

    The only thing I can think of is that you are editing (my)constants.rb with an editor other than Notepad and it is saving in some 'special' format that is not plain text. what are you using?
     
  2. ElkaderLight

    ElkaderLight New Member

    Offline
    Messages:
    19
    Trophy Points:
    1
    Weird., I have tried it a million different ways already but I will run a fresh documented try again.
    Test 1:
    1. Went to the folder:C:\Program Files (x86)\Google\Google SketchUp 8\Plugins\Phlatboyz
    2. Right-click MyConstants-example.rb and select copy
    3. Click in same folder and paste and get new file MyConstants-example-copy.rb
    4. Rename MyConstants-example-copy.rb to MyConstants.rb
    5. Open Sketchup8 and click on folder icon for Parameters (now expecting to see your mm and Davids )
    6. And low and behold it actually worked this time. Go figure.
    Now the real test. Changing your parameters to mine.
    Instead of opening in Notepad as I usually do I will right click and press the "Edit" option (which I just discovered existed). It appears to still open in Notepad.
    1. I change spindle speed and comments to minimize variables
    2. I open in Sketchup and see successful changes.
    3. Close Sketchup8
    4. Make my changes to the MyConstants.rb file through the Edit option. Save.
    5. Reopen Sketchup8. And Phlatbones is showing but now Phlatboyz. This tells me that I am changing a variable somewhere that is incompatible. I will try to make changes one by one to see where my error is. I will post when I find it to help anyone else who runs into this.
     
  3. ElkaderLight

    ElkaderLight New Member

    Offline
    Messages:
    19
    Trophy Points:
    1
    Okay, I finally got the file to recognize. I went through step by step each parameter, changing, then reloading sketchup. When there was an error, sketchup would not load phlatboyz tool bar at all until I removed the MyConstants.rb file entirely and started over. Once removed the Phlatboyz tool bar was recognized again.

    I am not sure I have a clear indication as to what was causing the error. I think it was in my designation of measurement perhaps. but I am not entirely sure. For inches, the entry "50.0.inch" seems to be working or "0.1875.inch". I know I was running into problems with my leading zero and missing "." ahead of the "inch" in the past, so maybe that was the problem.
    A quick test removing a "." before the "inch" shows this to be correct. It crashes the file and Phlatboyz toolset will not appear in Sketchup.
    Re-editing and putting the "." back in allows the toolbar to be seen and the MyConstants.rb settings to be seen correctly.
    It was user programming error. But maybe my experience will inform someone else or it can be written into the instructions as a point as I can see how it will be frustrating when Phlatboyz tool bar completely disappears for an "unkown" reason. For less experienced programming users like myself.

    All good now. And KUDOS to a really nice upgrade so far. Yay for saving time!
     
  4. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    This is because the stuff in MyConstants.rb is actually Ruby code, as with all programing languages it is very specific on formats.
    To give a mm value
    somevariable = 1.2.mm
    to give an inch value
    someinchvariable = 6.45.inch
    You are correct that the . before the mm or inch is absolutely vital as this tells Sketchup/Ruby how to interpret the value.
    All internal values in Sketchup are in inches so if you don't specify the units you get inches.

    And of course, any failure to write correct code will result in a read error and Sketchup will stop processing the files, resulting in no toolbar. If you do get such an error, it is usually the last thing you changed in the file (-: You can open the Ruby console (Windows|Ruby Console) and sometimes it will show error messages there. I havn't yet figured out how to force it to show startup errors, it just does it sometimes.

    Glad you got it sorted..... and that it is not a problem that will stop the release of 1.1... :)
     

Share This Page