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

    Topics

    • S

      Ruby "split" in file line reading

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      3k Views
      C
      @shirazbj said: Heard of regular expressions before, This time I tried to understand it. Thanks. Regular expression are simultaneously very useful and painful to work with. There is a great quote by Jamie Zawinski which goes "Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems." I first ran into them at Dive into Python 3 which gives a couple simple case studies and although the language is slightly different the regular expressions are basically the same. Looking at the regular expression given by /[-|+]?\d.\dE[-|+]?\d\d\d/ we have the / on each end marking the start and end of the expression. There are two blocks of [-|+]? which matches an optional + or - sign. I would read this is "0 or 1 instances of + or -". Then we have \d.\dE which matches a single digit, then some arbitrary number of digits until it find an E, then we again have an option sign followed by exactly 3 digits. So this pattern will match a single numerical value in the string given. The .scan method then constructs an array out of every match. From here you can wrap blocks in parenthesis to create groups so you can break the matches up into their own arrays which is what I had done originally until I realized Ruby would parse scientific notation with the .to_f method.
    • S

      Enums's index of an inputbox return

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      302 Views
      S
      all good now. I'll download the ruby book. Thanks dan.
    • S

      Color in add_line?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      229 Views
      S
      Found this: Edge color by material http://forums.sketchucation.com/viewtopic.php?f=180&t=35443#p312624 thx
    • S

      A Transformation demo

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      188 Views
      No one has replied
    • S

      An U bolt

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      587 Views
      S
      I read your PipeAlongPath code. I'm not using pre-selected path, instead generating by add_line+add_circle+add_line for U. add_circle return an array of edge, I need to include them into the path array. it works now (attached). Thanks draw a u-bolt
    • S

      Help on scale

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      291 Views
      TIGT
      @shirazbj said: Instead of writing every 'mm' in code, I thought it's more easy to draw as it is and scale back at the end. That also cleared me from inserting a DWG file, need scale back to get the dimensions show in right number. Thanks. An imported DWG will use whatever units it has set in the import 'options' dialog opened from the main DWG import browser, So you can rely on that to always be correct.
    • S

      How to avoid generating line between joint?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      19
      0 Votes
      19 Posts
      1k Views
      S
      Hi TIG, Finally made it and got my mesh. To cut through, need to cut from the opposite direction. To cut in (make a shell), need to cut from outside to inside. No need to do all the |e|e.erase! ... check. Thanks [image: GflN_mesh.gif]
    • S

      Need an example to munipulate a dynamic component with ruby

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      2k Views
      scottliningerS
      When you saved redsang.skp, did you File > Save As, or did you Right click > Save as? The File > Save As method is probably what happened. This isn't the same as saving sang as a standalone SKP. Try right clicking on red sang and "Save as" and then try the import. See if that works.
    • S

      Create component with a subroutine question

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      236 Views
      Chris FullmerC
      If you are creating them all like this: $bad_global_variable_new_group = entities.add_group $bad_global_variable_new_group = entities.add_group $bad_global_variable_new_group = entities.add_group $bad_global_variable_new_group = entities.add_group The variable only points to the last one. The first 3 will be lost.
    • S

      [code] intersect_with example

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      5k Views
      TIGT
      I suggest you trap for non-groups selection.each { |entity| ### next if not entity.class==Sketchup;;Group ### entity.entities.intersect_with(true, entity.transformation, entity.entities.parent, entity.transformation, true, entity.parent.entities.to_a) } Also shouldn't entity.entities.parent be entity.entities.parent.entities
    • 1 / 1