sketchucation logo sketchucation
    • Login
    1. Home
    2. danielbowring
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 12
    • Posts 67
    • Groups 1

    danielbowring

    @danielbowring

    10
    Reputation
    1
    Profile views
    67
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    danielbowring Unfollow Follow
    registered-users

    Latest posts made by danielbowring

    • RE: Hide/Show only every Nth Copied Instance?

      Yes, ruby does have a modulo operator - I said Dynamic Components doesn't provide a modulus function.

      posted in Dynamic Components
      danielbowringD
      danielbowring
    • RE: Hide/Show only every Nth Copied Instance?

      You should be using a modulo operation for this. A modulo operation will give the "remainder" of integer division. SketchUp doesn't provide a mod function for DCs, so you'll have to create it as such:

      a - (n * FLOOR(a/n))
      

      where a is the index and you want to hide every N.

      For example, if you have

      HIDDEN=COPY - (3 * FLOOR(COPY/3))==0
      

      , you'll get:

      HIDDEN, VISIBLE, VISIBLE, HIDDEN
      

      .

      You can change the compared value (in the above example, 0) to be the "offset", but it must be less than n.

      For example, if you have

      HIDDEN=COPY - (3 * FLOOR(COPY/3))==2
      

      , you'll get:

      VISIBLE, VISIBLE, HIDDEN, VISIBLE, ...
      

      .

      posted in Dynamic Components
      danielbowringD
      danielbowring
    • RE: Guidelines for adding a method to existing classes?

      @tt_su said:

      Note that extending Entity instances would not be allowed by EW because the instances are global to everyone using the SketchUp environment. But for other types such as Point3d, Vector3d, String etc that would work.

      Here delegators can be useful.

      
      require 'delegate'
      
      module DanielB
        class SampleFace < DelegateClass(Sketchup;;Face)
          def inner_loops
            return loops.find_all { |l| l != outer_loop }
          end
        end
      
        def self.demo
          face = Sketchup.active_model.selection.find { |e| e.is_a?(Sketchup;;Face) }
          return if face.nil?
          face = SampleFace.new(face)
          puts face.inner_loops
        end
      end
      
      
      posted in Developers' Forum
      danielbowringD
      danielbowring
    • RE: Need Help: DC constrain min/max scaling size

      If you want to avoid if statements, you can use SMALLEST and LARGEST like so

      =SMALLEST(MAX_VALUE, LARGEST(MIN_VALUE, value))
      
      posted in Dynamic Components
      danielbowringD
      danielbowring
    • RE: General question - definition of units (inch/metric)

      Thomthom wrote a guide for this.

      posted in Developers' Forum
      danielbowringD
      danielbowring
    • RE: Migrating plugins to SketchUp 2013

      Epic bump, but is there any news on this? Was upgrading the installation ruby put on the backburner? Should we still be expecting this sometime in the future (or a complete library at least)?

      To me at least, this seems like a really important feature - plugins and the community around them are a powerful part of sketchup.

      posted in Developers' Forum
      danielbowringD
      danielbowring
    • RE: [Project] Community Documentation Effort

      @tt_su said:

      Just so you're aware, we're looking into new solution for the API docs. I don't know of any time frame, yet though.

      That's great! I'll continue working on this in the meantime, though. There's still a lot of community info to round-up and it may even come of use once you guys have whatever it is you're planning sorted.

      Here's hoping you deprecate this soon ๐Ÿ˜›

      posted in Developers' Forum
      danielbowringD
      danielbowring
    • RE: [Project] Community Documentation Effort

      @rich o brien said:

      Is there a means of embedding that on a webpage here?

      I doubt there will be any particular mechanism (as there is for gists) because of demand reasons.

      posted in Developers' Forum
      danielbowringD
      danielbowring
    • RE: [Project] Community Documentation Effort

      Only other one I'm aware of is JimFoltz's, but his doesn't allow the kind of stuff a wiki can.

      posted in Developers' Forum
      danielbowringD
      danielbowring
    • [Project] Community Documentation Effort

      Hey,

      It's no secret that the documentation for the ruby API has its problems. We've asked for problems to be fixed (and we had comments for a while!) but it seems the dev team is too busy with other things to maintain it (which, in-of-itself is a good thing - SketchUp improvements!)

      So, I've started working on a community written API documentation. I've mostly decided on a style and layout, but before things are set in stone I'd like to have some input from other people.

      The project is hosted on Github and is made of of two parts:

      • A Wiki to hold information on all the classes, modules, methods, ... as well as tutorials and guides
      • A repository for non-trivial examples and resources (such as images)

      I'll be waiting a few days before I start the real effort so I can (hopefully) get some feedback from everyone. I suggest looking at the wiki page for UI, UI::WebDialog and UI::WebDialog#write_image for an example of each main "type" of page (module, class, method).

      I know a lot of the information is scattered around already (especially here on these forums), but hopefully we can consolidate it into one, organised location.

      posted in Developers' Forum
      danielbowringD
      danielbowring