sketchucation logo sketchucation
    • Login
    1. Home
    2. BryanHL
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    B
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 11
    • Groups 1

    BryanHL

    @BryanHL

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

    BryanHL Unfollow Follow
    registered-users

    Latest posts made by BryanHL

    • RE: Polyhedron plugin for review

      @box said:

      Seems like it starts a new model every time you use it. Not very helpful if you want to add the shape to a model.

      That is by design. And there is copy / paste... I guess an option could be to not create a new model every time. I do plan to add an HTML UI later and remove most of the menu items.

      I am more after comments re my attempt at classes and overall code design. UI issues can be dealt with later.

      posted in Developers' Forum
      B
      BryanHL
    • Polyhedron plugin for review

      [Edit:] updated the attachment to remove some testing settings.
      Is it better to upload the individual files instead of an rbz?

      I have been progressing this plugin a bit and figure it's time to get a review before I go much further. It's nowhere near finished...

      Basically it is to show various types of subdivisions available for different polyhedra

      Comments appreciated...

      Bryan


      Polyhedron.rbz

      posted in Developers' Forum
      B
      BryanHL
    • Error: #<TypeError: reference to deleted Entity>

      Noticed the following in the Ruby console when working on an extension.

      Error: #<TypeError: reference to deleted Entity>
      c:/users/.../appdata/roaming/sketchup/sketchup 2017/sketchup/plugins/su_dynamiccomponents/ruby/dcobservers.rbe:908:in get_attribute' c:/users/.../appdata/roaming/sketchup/sketchup 2017/sketchup/plugins/su_dynamiccomponents/ruby/dcobservers.rbe:908:in onActivePathChanged'

      At first I assumed an error in my extension but it was easily replicated in a fresh start of SU.

      Steps: Create some geometry, add it to a group or component. Open the group or component for editing, select all and delete. Then click anywhere on the screen and the the above appears in the console.

      Doesn't seem to have any other side effects.

      Note: I am on make, so no dynamic components...

      Bryan

      posted in SketchUp Bug Reporting sketchup
      B
      BryanHL
    • RE: Namespace in Multiple .rb Files

      @pixero said:

      If you temporarily comment out the line: unless file_loaded?(FILE) you can run the script again without restarting SU but you will get a new plugin menu entry for every time you run it.

      I had been loading the script from the console, then created a menu entry to do just that (from your How to Debug thread), but naively assumed it would reload any required files. Added another menu entry for the file in question and all is good...

      posted in Developers' Forum
      B
      BryanHL
    • RE: Namespace in Multiple .rb Files

      @tig said:

      module MyNameSpace
      > 
      >   module MyModels
      > 
      >     def self.model1()
      > 
      >       ...
      > 
      

      Should work ?
      Then any file using that module can call the method...

      Thanks TIG,

      that worked, although I thought I had tried that - maybe without a SU restart.

      On the SU forums Dan R also showed me extend self.

      posted in Developers' Forum
      B
      BryanHL
    • Namespace in Multiple .rb Files

      I am creating an extension and it is time to split everything out into multiple files.

      I have in my main file...

      require 'sketchup'
      
      require_relative 'Model1'
      
      module MyNameSpace
      
        module MyModels
      
          def self.create_model1
      
            ...
      
            model1
      
            ...
      
          end
      
          unless file_loaded?(__FILE__)
      
            # add menu items
      
            menu_Models = UI.menu('Extensions').add_submenu('My Models')
      
              menu_Model1.add_item('Model 1') {self.create_model1}
       
            ...
      
          end
        end
      end
      

      and in the second file

      
      def model1
      
        ...
      
      end
      

      After reading about namespaces I included the namespace and module names in the second file, as I had seen in other extensions.

      It was all working until a SketchUp restart and I got an
      "Error: #<NameError: undefined local variable or method model1 for MyNameSpace::MyModels:Module>"

      
      module MyNameSpace
      
        module MyModels
      
          def model1
      
            ...
      
          end
        end
      end
      

      After tearing my hair out I removed the namespace and module references and after a SU restart it works again.

      What have I misunderstood about namespaces and module names? If it means anything I am not using classes at all.

      Also, is there a way to reset the Ruby interpreter so a SU restart is not required?

      posted in Developers' Forum
      B
      BryanHL
    • RE: Scale howto - FredoScale???

      To answer my own post, I don't think it can be done because the angles change at one end of a strut, relative to the material thickness and radius of the sphere.

      posted in Extensions & Applications Discussions
      B
      BryanHL
    • Scale howto - FredoScale???

      Hi all,

      I am trying to scale the overall size (radius) of the attached model, with the length of each member scaling accordingly but not the width or thickness.

      I have installed FredoScale as research suggests that's the tool I need but I can't get my head around it...

      Is it possible?

      TIA


      IcosaV04DivAFlatEquBevelFrameDome.skp

      posted in Extensions & Applications Discussions extensions
      B
      BryanHL
    • RE: Beginning Ruby - Array and other Questions

      Hi TIG,

      I just posted re my Q1 when I realised what I was doing wrong...

      @unknownuser said:

      Q2:
      You don't need to make a reference to that face as you create it.
      However, it does no harm.
      Unless it'll be easy to retrieve a reference to that face later on - e.g. it's the only one in that entities collection...

      There will be many faces. I am creating polyhedrons.

      You used the word "collection" which was the reason for my post. Is the entities collection an ordered list? As in, if I put 5 in, I can get the 2nd one out from the 2nd position?

      @unknownuser said:

      Q3:
      You normally add the geometry into and entities context, so why would you want to add it into one context and move it into another ?

      I dunno, just learning...
      I was wondering if the geometry can be created separately. But maybe the methods are only available through the entities context?

      Lets say I make a face into a component. I have multiple instances of that component, and I want to add them all to a separate single instance component at the end...

      @unknownuser said:

      Q4:
      Any new definition you add to the model should appear in the Component Browser's model tray...

      Thx, I didn't notice it there bcoz no name...

      posted in Developers' Forum
      B
      BryanHL
    • RE: Beginning Ruby - Array and other Questions

      I can answer my first question myself

      In another language,

      
          arrIcosaVtxs = Array.new(12, Array.new(3))
      
          arrIcosaVtxs[0, 0] = (Geom;;Point3d.new(0,   0,   0))
          arrIcosaVtxs[0, 1] = (Geom;;Point3d.new(1.m, 0,   0))
          arrIcosaVtxs[0, 2] = (Geom;;Point3d.new(0,   1.m, 0))
      
      

      would be setting the array second dimension elements

      Just realised that in Ruby, the second digit after the comma above is a count...

      Tried this and it works

      
          arrIcosaVtxs[0][0] = (Geom;;Point3d.new(0,   0,   0))
          arrIcosaVtxs[0][1] = (Geom;;Point3d.new(1.m, 0,   0))
          arrIcosaVtxs[0][2] = (Geom;;Point3d.new(0,   1.m, 0))
      
      
      posted in Developers' Forum
      B
      BryanHL