sketchucation logo sketchucation
    • Login
    1. Home
    2. RickW
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ๐Ÿ”Œ Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download
    R
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 36
    • Posts 779
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Collaborative Effort - Ruby Template, RDoc, and Localization

      @unknownuser said:

      Purely my bias, but I'd lean toward the RDoc comment style. Either way, this looks extremely helpful!

      Using RD or RDoc style would be more consistent with the =begin/=end usage (rather than using it for block comments). Something like this?

      # Supports Organizer.rb
      
      =begin rdoc
      = ScriptName
      Copyright 2009, Author
      All Rights Reserved
      
      == Disclaimer
      THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
      
      == License
      author's license statement
      
      == Information
      Author;; AuthorName
      Organization;; AuthorAffiliationOrOrganizationIfAny
      Name;; ScriptName
      Version;; ScriptVersion
      SU Version;; MinimumSketchUpVersion
      Date;; Date
      Description;; ScriptDescription
      Usage;; ScriptUsageInstructions
      History;;
       1.000;; YYYY-MM-DD
         * description1
         * description2
       1.001;; YYYY-MM-DD
         * description1
         * description2
      
      =end
      
      require "sketchup.rb"
      
      
      
      unless file_loaded?(__FILE__)
         file_loaded(__FILE__)
         UI.add_context_menu_handler do |menu|
            menu.add_item("menuitem") { code } # CREATE A SINGLE MENU ITEM IN CONTEXT MENU
            submenu = menu.add_submenu("submenu") # CREATE A SUBMENU ITEM IN CONTEXT MENU
               submenu.add_item("menuitem1") { code }
               submenu.add_item("menuitem2") { code }
         end
         $submenu ? (organizer = $submenu) ; (organizer = UI.menu("Plugins"))
         organizer.add_item("menuitem") { code } # CREATE A SINGLE MENU ITEM
         submenu = organizer.add_submenu("submenu") # CREATE A SUBMENU ITEM
            submenu.add_item("menuitem1") { code }
            submenu.add_item("menuitem2") { code }
      end
      
      
      
      posted in Developers' Forum
      R
      RickW
    • RE: [Plugin] Loose Geometry to Groups (Updated August 28, 2009)

      Chris,
      Congrats on your first script! Way to jump in and make things happen ๐Ÿ˜„
      Regarding classes and understanding them a little bit more - they are like the framework for objects. They contain the rules for behavior and parameters. When you want one of those objects, you create an instance of it. That instance will behave like other instances that share similar parameters.

      I created this (overly simple) example a long time (5 years) ago, on the old SketchUp forum. Perhaps it will help.

      As for understanding modules, let's continue with the Ball class. I like playtime with my 15-month-old son. He has several toy balls that he plays with. With him in mind, I would write the Ball class as in my linked example.

      On the other hand, my wife loves to dance. With her in mind, I would write a Ball class like this:

      class Ball
        def initialize
          #code goes here
        end
      
        def music=(style)
          #code goes here
        end
      
        def orchestra_size=(i)
          #code goes here
        end
      
        def refreshments=(good_eats)
          #code goes here
        end
      
      end # class Ball
      
      strictly_ballroom = Ball.new
      strictly_ballroom.orchestra_size=50
      strictly_ballroom.refreshments=["caviar","champagne","cheese","foie gras","hot wings"]
      etc...
      

      The problem is that both classes have the same name, but different methods and uses. A toy ball isn't likely to need refreshments or an orchestra size, and a grand ball with dancing and an orchestra isn't likely to be inflated or inclined to bounce. Yet if both files were loaded, a bizarre merger would occur where one could see bouncing ballrooms and round rubber toys stuffed with hors d'oeuvres. That's where modules come into play.

      module Toys
        class Ball
          ...etc
        end
      end
      
      module Parties
        class Ball
          ...etc
        end
      end
      
      bouncyball = Toys;;Ball.new
      grandball = Parties;;Ball.new
      

      This significantly cuts down on the possibility of conflicting classes and methods, but even then, selecting a unique module name is important.

      posted in Plugins
      R
      RickW
    • [Plugin] Toggle Break Edges

      The new "auto break edges" behavior in SU 7 is a great timesaver in most regards, but there are occasions when that behavior is not desired.

      ToggleBreakEdges provides your choice of two toolbars to toggle the functionality off/on as desired.

      One toolbar has two buttons, one to turn off the break_edges functionality and the second to turn it on.

      The second toolbar has only one button that toggles the functionality.

      In both cases, the appearance of the button(s) indicate the status.

      • For the 2-button toolbar, the button corresponding to the current state is shown indented.
      • For the 1-button toolbar, the button is indented when the functionality is active, and standard when the functionality is off.

      The plugin also features right-click menu access to toggle the functionality as well as a standard menu item for toggling (for keyboard shortcut assignment) and access to settings.


      two-button toolbar

      posted in Plugins
      R
      RickW
    • RE: Guy charging U$100 for package containing free rubies!!

      Back when we were learning ruby, many of us started with one of the @Last scripts and modified it. Or, we started with a script that was itself modified from an @Last script. We then modified our own scripts, and/or used the header info as a template.

      After the copyright line, all the @Last scripts contained the following phrase:

      @unknownuser said:

      Permission to use, copy, modify, and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies.

      Any author that failed to delete that phrase from a given script has no recourse.

      I have wanted for some time to set up a pair of new templates (one with the phrase and one without) that also have the menu structure set up for Organizer.rb

      I'd be happy to post them here for collaborative editing so we can all end up with standardized templates that will work for us, will be(come) universal, and will allow quick parsing for script name, author's name, date, version, description, checksum, etc., so that Didier's site and any future version-update-checker scripts could quickly list and compare scripts/versions.

      EDIT: I started a new thread for the template

      posted in Developers' Forum
      R
      RickW
    • Collaborative Effort - Ruby Template, RDoc, and Localization

      This is a template for an "all rights reserved" project. Anyone not wanting to reserve all rights could replace that line with this phrase

      @unknownuser said:

      Permission to use, copy, modify, and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies.

      or a different phrase of your preference.

      # Supports Organizer.rb
      
      =begin rdoc
      = ScriptName
      Copyright 2009, Author
      All Rights Reserved
      
      == Disclaimer
      THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
      
      == License
      author's license statement
      
      == Information
      Author;; AuthorName
      Organization;; AuthorAffiliationOrOrganizationIfAny
      Name;; ScriptName
      Version;; ScriptVersion
      SU Version;; MinimumSketchUpVersion
      Date;; Date
      Description;; ScriptDescription
      Usage;; ScriptUsageInstructions
      History;;
      1.000;; YYYY-MM-DD
         * description1
         * description2
      1.001;; YYYY-MM-DD
         * description1
         * description2
      
      =end
      
      require "sketchup.rb"
      
      
      
      unless file_loaded?(__FILE__)
         file_loaded(__FILE__)
         UI.add_context_menu_handler do |menu|
            menu.add_item("menuitem") { code } # CREATE A SINGLE MENU ITEM IN CONTEXT MENU
            submenu = menu.add_submenu("submenu") # CREATE A SUBMENU ITEM IN CONTEXT MENU
               submenu.add_item("menuitem1") { code }
               submenu.add_item("menuitem2") { code }
         end
         $submenu ? (organizer = $submenu) ; (organizer = UI.menu("Plugins"))
         organizer.add_item("menuitem") { code } # CREATE A SINGLE MENU ITEM
         submenu = organizer.add_submenu("submenu") # CREATE A SUBMENU ITEM
            submenu.add_item("menuitem1") { code }
            submenu.add_item("menuitem2") { code }
      end
      
      

      Feedback?
      Does anyone really want to use the embedded documentation format?
      Does anyone really want to use the embedded html (=begin html) format?
      Does anyone have an idea for templating the menuitems for language localization?

      EDIT 2009-01-29: added a descriptor for the minimum SketchUp version required (thanks Thomas). The "default" would be '4' since that is when ruby was added to SU.
      EDIT 2011-10-19: changed the above code sample to match the revised code sample from a later post, in hopes of alleviating confusion. For posterity's sake, the original code sample is here:

      # Supports Organizer.rb
      
      =begin
      Copyright 2009, Author
      All Rights Reserved
      
      THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
      
      License;	author's license statement
      
      Author;		AuthorName
      Organization;	AuthorAffiliationOrOrganizationIfAny
      Name;		ScriptName
      Version;	ScriptVersion
      SU Version;	MinimumSketchUpVersion
      Date;		Date
      Description;	ScriptDescription
      Usage;		ScriptUsageInstructions
      History;
      	1.000	YYYY-MM-DD
      		description1
      		description2
      	1.001	YYYY-MM-DD
      		description1
      		description2
      
      =end
      
      require "sketchup.rb"
      
      
      
      unless file_loaded?(__FILE__)
      	file_loaded(__FILE__)
      	UI.add_context_menu_handler do |menu|
      		menu.add_item("menuitem") { code } # CREATE A SINGLE MENU ITEM IN CONTEXT MENU
      		submenu = menu.add_submenu("submenu") # CREATE A SUBMENU ITEM IN CONTEXT MENU
      			submenu.add_item("menuitem1") { code }
      			submenu.add_item("menuitem2") { code }
      	end
      	$submenu ? (organizer = $submenu) ; (organizer = UI.menu("Plugins"))
      	organizer.add_item("menuitem") { code } # CREATE A SINGLE MENU ITEM
      	submenu = organizer.add_submenu("submenu") # CREATE A SUBMENU ITEM
      		submenu.add_item("menuitem1") { code }
      		submenu.add_item("menuitem2") { code }
      end
      
      
      
      posted in Developers' Forum
      R
      RickW
    • RE: Will "Change" really happen starting Tuesday?

      Well, it's good to see you're branching out on your replies. The ROFLMAL icon was getting a bit old. ๐Ÿ˜„

      Of course, "substantive" is in the mind of the reader. When I thought we were honestly discussing different viewpoints, you apparently thought I was attacking you. From that viewpoint, I can understand why you respond the way you do.

      That's water under the bridge, but the point is this: I am glad to have your opinion on things if it rises above an icon. We may not agree, but it's the exercising of our freedom of speech that is paramount - the day may come when we long for the days when we could disagree peacably and publicly.

      posted in Corner Bar
      R
      RickW
    • RE: The curruption will (did) prevail - rant

      I'm not too sure things are going to change quite yet - at least not for the better. A tax evader was just approved as Treasury Secretary. ๐Ÿ˜ฒ

      Worst case: lending dries up, which means no "new" money to grow the economy; jobs are lost on a massive scale; an American public that has grown accustomed to relying on government demands a solution; in the ensuing panic, the Constitution is eroded as new government programs are enacted and government power reduces our freedoms; and the ultimate nanny state is finally put in place in the U.S.

      Best case: lending dries up, which means no "new" money to grow the economy; jobs are lost on a massive scale; an American public that has grown accustomed to relying on government to solve the problems the people should solve finally wakes up and realizes the government can't do much of anything correctly; people demand restoration of Constitutional government and the rule of law; the clowns are voted out and replaced with people who will support Congressional term limits and limited government; revision of the financial system to a more stable, equitable, and sustainable system results in a stronger economy.

      posted in Corner Bar
      R
      RickW
    • RE: The curruption will (did) prevail - rant

      Mr S was on target. The quote from Jefferson was right on, and that is where the true problem lies.

      Banks, not the Stock Market, are the ones who create money out of thin air - in the form of loans. When they lend, the full amount of the loan is not required to be held in reserve. In the US, it's at a ratio of around 9:1 loan:reserve.

      That creates the possibility of 90 times the amount of real money available existing as loans that need to be repaid with interest. But since the amount of lent money already exceeds the real money available, that means someone has to default in order for someone else to pay off their loan with interest - unless the banks keep conjuring new money out of nowhere (but that just means even more debt).

      Further, that imaginary money created by the bank as a loan is deposited in another bank, and becomes available for further lending. Customer deposits and central reserve deposits (from the bank's own money) are handled differently: a bank can lend 90% of customer deposits (9:1 loans:reserves).

      Example:
      Fred decides to open a bank, Bank1. After his startup costs, he has $1111.12. He puts this money into reserve at the central bank.
      Since Bank1 has $1111.12 in reserve at the central bank (the bank's own money, not money from deposits), it can legally lend out at a 9:1 ratio, or $10,000 dollars.
      Borrower1 takes out a $10k loan from Bank1 and buys a car.
      The seller takes the $10k and deposits it at his bank, Bank2.
      Bank2 can now lend $9k against that deposit, holding $1k in reserve.
      Borrower2 takes out a $9k loan and buys materials for a home improvement project.
      The home improvement store deposits the $9k in their bank, Bank3.
      Bank3 can now lend $8100 against that deposit, holding $900 in reserve.
      Borrower3 takes out a loan of $8100, makes a purchase, and the seller puts the money into his bank (Bank1, Bank2, Bank3, or any other bank), and the process keeps repeating.

      If the minimum loan amount is $1, then the total money created out of thin air by the banking system from that initial $1,111.12 is $99,990.59.

      Now multiply by a few billion, and then mix in high-risk mortgage loans for overvalued properties that can't be resold...

      posted in Corner Bar
      R
      RickW
    • RE: Will "Change" really happen starting Tuesday?

      Well, Tom, it's clear you're not concerned with credibility, eloquence, or consideration. At least you were consistent in that regard, and succeeded once again in avoiding a meaningful contribution to the discussion. ๐Ÿ˜„

      posted in Corner Bar
      R
      RickW
    • RE: How do you calculate area of a face inside a scaled comp?

      Okay, for your specific example:
      The face was drawn at an angle, so get the plane info.
      face.plane will yield a throwaway (in this case), the sin, and the cos values.
      You want to multiply the sin by the z scale factor (1.6 in this case) to find the new height of the top edge. Once you have the new height, get the hypotenuse of the cos and the height. Multiply all that by the other scale factor and the original area.

      
      t = group.transformation.to_a
      area = face.area*Math.hypot(Math.cos(30.degrees),Math.sin(30.degrees)*t[10])*t[0]
      

      Keep in mind, rotating the g/c or changing the y scale factor will affect things similarly, and you'll have to take that into account and modify your calcs accordingly. But I hope that can get you started.

      No chickens were harmed in the creation of this code snippet (though one did find its way into my lunch a little while ago).

      posted in Developers' Forum
      R
      RickW
    • RE: How do you calculate area of a face inside a scaled comp?

      I checked the face.plane for the object, and it reports the plane as still being at a 30 degree angle, with an area just under 10,000 units. I can approximate the actual area by dividing the reported area by Math.cos(30.degrees) and multiplying the result by 1.3 (the other scale factor), but that's not close enough. Still working...

      posted in Developers' Forum
      R
      RickW
    • RE: How do you calculate area of a face inside a scaled comp?

      As I recall, it's a very complex procedure involving a lot of trigonometry, intense calculations, and sacrificing a chicken at solstice (for SU4-6; for SU7+, it's at equinox).

      posted in Developers' Forum
      R
      RickW
    • RE: Getting file paths in SU 7

      @jim said:

      I know it barfs when the file is encrypted.

      We've asked Google to fix this, but no dice yet.
      Ditto on Ruby access to Dimension objects.

      posted in Developers' Forum
      R
      RickW
    • RE: Can we create parametric in new component by ruby script ?

      It is theoretically possible, but I don't know if anyone has tried yet.

      posted in Developers' Forum
      R
      RickW
    • RE: Dimensions Added as Objects Are Drawn - Feedback Please

      @xrok1 said:

      maybe Whaat could take a crack at this! he seems to be able to bend Sketchup to his will.

      Conceptually, it's not a hard script to write - a couple of observers, a bit of code, and it's done. The issue is that Ruby does not have access to SU's dimension objects, either to create or modify them. That capability is essential to this project. That is, unless one invests an inordinate amount of time into workarounds.

      posted in Developers' Forum
      R
      RickW
    • RE: Will "Change" really happen starting Tuesday?

      @chango70 said:

      Yes everything so far points to a better if not great presidency

      If by "great presidency" you mean a total disaster for the US, then I agree with you completely.

      @mike lucey said:

      I think many more good changes for the better are under way and will follow...I think President Obama will continue to inspire not only US citizens but the rest of the World to get a handle on things before it is too late.

      He only inspires me to gag.

      I've been looking at the White House website and his agenda (an agenda he either hid or lied about during the campaign). He seems intent on overthrowing the will of the majority of Americans (expressed at the polls) on several issues, trampling states' rights on other issues, and generally expanding the power, scope, reach, and inefficiency of the federal bureaucracy, to our detriment. It's a far cry from the limited federal government set up by the Founders, a far cry from unifying, and completely uninspiring.

      And let's not overlook his abysmal choice of nominee for head of the Treasury Department - a tax evader! It's like making an arsonist the Fire Chief.

      Bread and circuses, anyone?

      Oh, and Tomsdesk - if all you can reply with is a ROFLMAO icon, save yourself the trouble. I already know you disagree with me.

      posted in Corner Bar
      R
      RickW
    • RE: Will "Change" really happen starting Tuesday?

      So, if an anarchic "government" is not compulsory, how can it govern? (It's really a rhetorical question.)

      History tends to repeat itself, and it seems to be repeating itself right now - looking at what happened in ancient Rome, and what's happening in the US. No, there are no guarantees, but the trends are there.

      posted in Corner Bar
      R
      RickW
    • RE: Will "Change" really happen starting Tuesday?

      @chango70 said:

      Good ol' Wikipedia tells it like it is.

      Yeah, it starts out by saying that anarchism is the absence of compulsory government. That means 0%. You can quote all the nuance you want, but the basic definition means no government.

      The video states clearly they are NOT looking at things from a traditional left/right standpoint, but from the standpoint of the power of government along a continnum from 0% to 100%. Your comment leaves the impression that you belive that looking at things in an unconventional way is lame.

      Do you also disagree with the premise that an unmaintained republic will give way to democracy, which will end with oligarchy?

      posted in Corner Bar
      R
      RickW
    • 1
    • 2
    • 9
    • 10
    • 11
    • 12
    • 13
    • 38
    • 39
    • 11 / 39