sketchucation logo sketchucation
    • Login
    1. Home
    2. sdmitch
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now
    Offline
    • Profile
    • Following 0
    • Followers 3
    • Topics 54
    • Posts 1,483
    • Groups 2

    sdmitch

    @sdmitch

    20
    Reputation
    102
    Profile views
    1.5k
    Posts
    3
    Followers
    0
    Following
    Joined
    Last Online

    sdmitch Unfollow Follow
    Extension Creator registered-users

    Latest posts made by sdmitch

    • RE: Resolve [Ruby help] Script for create window sills

      Part 1 works if you delete or comment out the ad=sel.ent statement which is invalid.

      Part 2 doesn't work because the faces created by the pushpull operation are not automatically added to the selection. Also you reuse the faces array which only contains the original faces selected.

      Here is how I would do it

      mod = Sketchup.active_model
      ent = mod.active_entities
      sel = mod.selection
      SKETCHUP_CONSOLE.clear
      appuicolor = Sketchup;;Color.new(238,130,238)
      sel.grep(Sketchup;;Face).each do |appui|
        appui.material = appuicolor
        appui.back_material = appuicolor
        old = ent.to_a
        status = appui.pushpull(-30.mm , true)
        new = ent.to_a - old
        new.grep(Sketchup;;Face).select{|f|f.normal.z==0}.each{|f|f.pushpull 30.mm}
      end
      
      
      posted in Developers' Forum
      sdmitchS
      sdmitch
    • RE: Replace component with random components

      @unknownuser said:

      What happen to this plugin? Would be so great to have it... Will save LOTS of time πŸ˜„

      The plugin was my ComponentReplacement which can be found on my blog page. Click the "plugin" link then click download. It requires that the "source" instances be given the same instance name and the "target" instances also have the same instance name. The instance name is accessible through the Entity Info window.

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: Make Face Multiple Solids

      Repaired SimpleFrame and code used

      mod = Sketchup.active_model
      ent = mod.active_entities
      sel = mod.selection
      SKETCHUP_CONSOLE.clear
      ent.grep(Sketchup;;Group).each{|g|
       edg = g.entities.grep(Sketchup;;Edge).select{|e|e.faces.count==1}
       edg.each{|e|e.find_faces}; remove=[]
       g.entities.grep(Sketchup;;Edge).each{|e| remove<<e if e.faces.length==2 && e.faces[0].normal.parallel?(e.faces[1].normal)}
       ent.erase_entities(remove.reverse)
      }
      

      SimpleFrameRepaired.skp

      posted in Newbie Forum
      sdmitchS
      sdmitch
    • RE: Who could help to develop this rb?
      
      # version;
      # Added Undo
      
      module JF
        def self.layer_face_camera
          layers = Sketchup.active_model.layers
          name = UI.inputbox(["Layer;","On/Off;"], [layers[0].name,"Off"], [layers.map{|l|l.name}.join("|"),"On|Off"])
          return unless name
          Sketchup.active_model.start_operation("Layer Face Camera")
          Sketchup.active_model.entities.each { |ent|
            next unless ent.is_a? Sketchup;;ComponentInstance
            next unless ent.layer.name == name[0]
            cdef = ent.definition
            cdef.behavior.always_face_camera = true if name[1]=="On"
            cdef.behavior.always_face_camera = false if name[1]=="Off"
          }
          Sketchup.active_model.commit_operation
        end
      end
      
      
      
      posted in Extensions & Applications Discussions
      sdmitchS
      sdmitch
    • RE: Move vertices down to surface

      @pbacot said:

      sdmitch: It worked awesomely. Thank you! What can I do in return?

      You're welcome. Nothing.

      posted in SketchUp Discussions
      sdmitchS
      sdmitch
    • RE: Move vertices down to surface
      
      mod = Sketchup.active_model
      ent = mod.entities
      sel = mod.selection
      SKETCHUP_CONSOLE.clear
      edgs = sel.grep(Sketchup;;Edge)
      if edgs[0]
        vers = edgs.map{|e|e.vertices}.flatten.uniq;
        vecs = []; vrts = []; axis = [0,0,-1]
        for v in vers
          p=v.position;
          h=mod.raytest([p,axis]);
          if h
            vrts << v;
            vecs << p.vector_to(h[0])
          end
        end
        ent.transform_by_vectors(vrts,vecs)
      else
        puts "select edge(s)"
      end
      
      
      
      posted in SketchUp Discussions
      sdmitchS
      sdmitch
    • RE: Select *Most* Collinear Edges

      @m3damind said:

      Is there a plugin to do the following?

      Select Edge
      Operation: read connected edges at selected edge vertices, add to selection the most collinear (In-line with) edge attached to vertice and disregard the rest. Repeat until no edges fall under a custom angle parameter (i.e. X=30Β°).

      An operation that would start and end as shown on the attached.

      Try this

      mod = Sketchup.active_model
      ent = mod.active_entities
      sel = mod.selection
      val = UI.inputbox(["Max Ang;"],[30.0],"Most Colinear")
      if val
        max_ang = val[0].degrees
        sel_edg = sel.first
        sel_edg.vertices.each{|start|
          found=true; nxt_edg = sel_edg
          while found
            found=false;
            if start.edges.length > 1
              edges=start.edges-[nxt_edg];
              vec = nxt_edg.line[1]
              edg = edges.min_by{|e|vec.angle_between(e.line[1])}
              ang = vec.angle_between(edg.line[1])
              if  ang < max_ang || ang > Math;;PI-max_ang
                sel.add edg;found=true;
                start = edg.other_vertex(start)
                nxt_edg = edg;
              end
            end
          end
        }
      end
      
      

      Most Colinear.gif

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: Turn off all layers except selected?

      Make selection, paste following code into Ruby Console, press Enter.

      
      mod = Sketchup.active_model
      sel = mod.selection
      unless sel.empty?
        layers = []
        sel.to_a.each{|e|
          layers << e.layer
        }
        layers.flatten!;layers.uniq!
        mod.layers.each{|l|
          next if layers.include?(l)
          l.visible=false
        }
      end
      
      
      posted in Newbie Forum
      sdmitchS
      sdmitch
    • RE: [Plugin] FloorGenerator ( Updated 6-Apr-2017)

      @utiler said:

      Where has the complaint come from??

      Apparently from Trimble and I still have no idea why or what the complaint is about.


      Capture.PNG

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: [Plugin] FloorGenerator ( Updated 6-Apr-2017)

      @dimashariyanto said:

      where i can download this plugin? i have been download from the site http://sdmitch.blogspot.com/ but wan't work.. thanks

      I have removed the plugin from the blog and plugin store because I have received a complaint regarding Copyright infringement.

      posted in Plugins
      sdmitchS
      sdmitch