sketchucation logo sketchucation
    • Login
    1. Home
    2. sdmitch
    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!
    ⚠️ Important | Libfredo 15.8b introduces important bugfixes for Fredo's Extensions Update
    Offline
    • Profile
    • Following 0
    • Followers 4
    • Topics 54
    • Posts 1,483
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: [plugin] Rotated Box [updated 30-Mar-2014]

      @gilles said:

      Very useful, I would love a rotated circle for years 😞

      Thanks a lot πŸ‘

      OK, just how would you design this plugin, a circle through 3 points or maybe center, a point to define the radius, and a point to define the plane, or maybe the ends of the diameter and a point to define the plane. Please don't say "all of the above", pick one.

      posted in Plugins
      sdmitchS
      sdmitch
    • [plugin] Rotated Box [updated 30-Mar-2014]

      Updated to be SU 2014 compatible. Not tested in SU 2013
      Fixed displacement some time caused by dimension entry.

      In response to "draw box with 3 click"
      http://forums.sketchucation.com/viewtopic.php?f=323%26amp;t=45764

      Version 1.2.1 The "@ent=@mod.entities" has been changed to "@ent=@mod.active_entities" so you can add boxes to any component or group that is open for edit. Is everyone happy now?

      Version 1.2 If grouping is on, the axes are aligned to the group. MAC's use Alt key to toggle grouping.

      Version 1.1 In addition to a few minor tweaks, grouping can be turned on and off using the Ctrl key.

      Rotated Box is the natural extension of the long existing Rotated Rectangle with the 3rd dimension added. The Width, Depth, and Height can be defined graphically or keyed in. The plane is established by the three points that define the rectangle and a guide line is temporarily displayed to aid in the definition of the height. The resulting box is created as a group.


      Rotated Box.rb

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: [Plugin] Stair Maker

      Yes, the railing and post system is premitive but I never intended it to be more and my intentions have not changed.

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: [REQ] draw box with 3 click

      Post deleted.

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: [REQ] draw box with 3 click

      the.pjt,

      Your English is alot better than my Arabic so no need to apologize. I usually prefer writing my on code rather than having to decipher someone elses then modify it. Since I was familiar with the existing Rotated Rectangle Tool, I did use it as the basis for Rotated Box and added the code necessary for the 4th point. In testing this plugin, I had the same problem with the display of the edges defining the box as it was being defined but it is only a display thing and has no effect on the final box created.

      Get another copy of the previously posted Rotated Box plugin. It now operates on any plane.

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: [REQ] draw box with 3 click

      Here is the beta version of Rotated Box. It now works above or below the plane defined by points 1,2, and 3.


      beta version

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: [REQ] draw box with 3 click

      The missing lines in the view is due to the current camera position and view aspect. Orbiting and zooming will solve this problem.

      In your second post you specifically asked for a plugin that
      @unknownuser said:

      first click for base point , secound click for box X and Y and third click for its height (Z)

      which is how I did it in my plugin. No mention of a rotated rectangle or faces or groups. Since it takes 3 clicks to draw a rotated rectangle, it is not possible to draw a box in 3 clicks.

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: [REQ] draw box with 3 click

      If you refer back to my previous post, I asked if you wanted wireframe or faces. You didn't respond to my question nor have you ever mentioned that it should be grouped. Neither of which is any big deal but if you don't specify what you want then it is up to us to guess.

      I made a modification so that you can now click and drag to define the base so now it is possible to draw the box in two clicks.


      Box In 3 Clicks.rb

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: [REQ] draw box with 3 click

      Are you looking for a wireframe box like the bounding box of a group or component or a solid box with faces?

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: How to Write variable value into test.txt file

      I have never had a problem with File.open just the path string for the file regarding the use of "". The code I encluded in my last post was tested and worked in Ruby Web Console, Ruby Console, and a plugin.

      posted in Developers' Forum
      sdmitchS
      sdmitch
    • RE: How to Write variable value into test.txt file

      It could be something as simple as trying to write a file to the root directory. Windows Vista says that I don't have access even from the admistrator account.

      Try this

      	File;;open(File.join(File.dirname(__FILE__),'foo.txt'), 'wb') {|f| f.write $variablename } 
      
      

      which will create the file in the script directory.

      posted in Developers' Forum
      sdmitchS
      sdmitch
    • RE: How to Write variable value into test.txt file

      Ruby uses the '' to quote the next character so in the script you either need to double the character '\' or use '/' instead.

      'wb' ??? Sketchup uses Ruby 8.? version and this may not be supported. I don't find this context in my Ruby reference book.

      posted in Developers' Forum
      sdmitchS
      sdmitch
    • RE: Lengthening a series of lines in equal increments

      @davecon said:

      Thanks for the help so far everyone πŸ˜„

      I have got the hang of doing this on a straight line, now the complex bit is trying to do it on a spiral. Currently I am trying to turn the model on the left (spiral with even length lines) in the model on the right (spiral with lines increasing by XX per length)
      [attachment=1:2ramdbm4]<!-- ia1 -->spiral lines.jpg<!-- ia1 -->[/attachment:2ramdbm4]

      Ideally what I would like to be able to do is select the first line (red) and then the last line (green) and be able to input something like "starting the with the first line make all the others increase in XXmm increments"

      Here is the file itself so far.
      [attachment=0:2ramdbm4]<!-- ia0 -->spiral lines.skp<!-- ia0 -->[/attachment:2ramdbm4]

      Instead of going to the trouble of creating the equal length lines then extending them incrementally, I would make the "baseline", be it a flat spiral or a straight line divided into the desired number of segments, into a curve using weld and then you can create the lines originating from the curve's vertices.

      The code to do this is as simple as this

      mod = Sketchup.active_model
      ent = mod.entities
      sel = mod.selection
      if !sel.empty? && sel.first.curve
       vers=sel.first.curve.vertices
      # d is initial length, i is the increment, and a is the direction vector
       d=875.0.mm;i=87.5.mm;a=[0,0,-1]
       for v in vers
        p=v.position;pp=p.offset(a,d)
        ent.add_line(p,pp)
        d += i
       end
      else
       UI.messagebox "select a curve"
      end
      
      

      It would be a monumental task to try to figure out the order of the equal length lines. When you select a group of anything, there is no guaranty that Sketchup will add them to the selection in the proper order. At least that has been my experience.

      posted in Newbie Forum
      sdmitchS
      sdmitch
    • RE: [Plugin] WireTool (Catenary) (1.4.1) – updated 06.03.2013

      When I tried the plugin, I kept getting a canatnary drawn from the origin to my first pick point. Adding a @state = 0 to the def initialize method fixed this problem.

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: Boardwalk around a curve

      Unfortunately Stepping Stones doesn't work very well around "sharp" corners.

      posted in Newbie Forum
      sdmitchS
      sdmitch
    • RE: Pointcloud - Joining the Dots

      In Ruby, sub-routines are refered to as methods and are defined by "def method_name" as the first line and "end" as the last line. Modules contain any number of methods and are defined by "module Module_Name" as the first line and "end" as the last line. When a method is placed inside a module, it is normally coded def self.method_name where self. refers to the module containing it. Two modules can contain methods with same name but do different things and there is no conflict because the modules will have different names.

      You should get a Ruby programming reference book if you ever expect to read and understand what the various code statements mean.

      posted in Newbie Forum
      sdmitchS
      sdmitch
    • RE: Count verticies?

      You can find a simple vertex counter of mine here.

      http://forums.sketchucation.com/viewtopic.php?f=323&t=41953

      posted in Plugins
      sdmitchS
      sdmitch
    • RE: Pointcloud - Joining the Dots

      My guess is no because you would have lost the relationship between the vertices that have been converted to construction points.

      posted in Newbie Forum
      sdmitchS
      sdmitch
    • RE: Pointcloud - Joining the Dots

      It needs to be included in a method and a module to identify and isolate it from the other plugins that may be loaded. I have made the necessary additions to allow you to copy the plugin to the plugins folder and have it appear in the plugins menu.

      Please understand that this plugin, as written, applies to this single case only and the construction points near the model origin must be deleted before the plugin is run so that there are only the 2160 construction points that define the 6 rings.


      Joining The Dots.rb

      posted in Newbie Forum
      sdmitchS
      sdmitch
    • RE: Pointcloud - Joining the Dots

      What defines the 3rd ring?

      I used this code to triangulate two of them after I figured out how they were ordered in the model.

      mod = Sketchup.active_model
      ent = mod.entities
      sel = mod.selection
      # collect the construction point locations in groups of 360
      pts=[];ring=[]
      ent.each{|e|
       if e.class==Sketchup;;ConstructionPoint
        ring<<e.position
        if ring.length>=360
         pts<<ring;
         ring=[]
        end
       end
      }
      # triangulate the rings
      for i in 0...360
      
       ent.add_face(pts[0][i],pts[2][i-1],pts[2][i])
       ent.add_face(pts[0][i],pts[0][i-1],pts[2][i-1])
       ent.add_face(pts[0][i],pts[4][i-1],pts[4][i])
       ent.add_face(pts[0][i],pts[0][i-1],pts[4][i-1])
      
       ent.add_face(pts[1][i],pts[3][i-1],pts[3][i])
       ent.add_face(pts[1][i],pts[1][i-1],pts[3][i-1])
       ent.add_face(pts[1][i],pts[5][i-1],pts[5][i])
       ent.add_face(pts[1][i],pts[1][i-1],pts[5][i-1])
      
      end
      
      

      Equatorial TriRing2.skp

      posted in Newbie Forum
      sdmitchS
      sdmitch
    • 1
    • 2
    • 54
    • 55
    • 56
    • 57
    • 58
    • 74
    • 75
    • 56 / 75