• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Ruby Code Snippets

Scheduled Pinned Locked Moved Developers' Forum
26 Posts 7 Posters 1.3k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    Larsen
    last edited by Larsen 20 Jan 2011, 12:21

    What do you think to initiate a discussion, named "Ruby Code Snippets",Sketchup Specific, to help new commer to Ruby to grasp the BASICSpatterns of programming.

    Thanks.

    [Every form of thinking perish by excess of its basic principles.

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 20 Jan 2011, 13:57

      @larsen said:

      What do you think to initiate a discussion, named "Ruby Code Snippets",Sketchup Specific, totally independant of "Developers' Forum" to help new commer to Ruby to grasp the BASICSpatterns of programming.

      Sounds interesting, but I'm confused on how SketchUp specific Ruby discussion would help newcomers to understand basic programming pattern. Basic programming patterns is a generic thing - so how would you go SketchUp specific? Or even why?

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • L Offline
        Larsen
        last edited by 20 Jan 2011, 14:13

        Imagine a newbie who knows the ABC of Ruby programming. He's lost among 1000 code lines and doesn't grasp the essence of a plugin. Snippet (10 or so of lines) does.
        Thnxs.

        [Every form of thinking perish by excess of its basic principles.

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 20 Jan 2011, 15:17

          @larsen said:

          Imagine a newbie who knows the ABC of Ruby programming. He's lost among 1000 code lines and doesn't grasp the essence of a plugin. Snippet (10 or so of lines) does.
          Thnxs.

          Yes - as long as one makes the assumption that they know the basics of the language.

          Have you looked at the snippets linked in the previous link? Got a particular concept in mind? Particular beginner issues to address?

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • C Offline
            Chris Fullmer
            last edited by 20 Jan 2011, 16:05

            There are lots of snippets lying around. I started a video tutorial series where I specify a simple task then write the code to accomplish, explaining line by line what the code is doing. The API also has many snippets of code in it (definietly could use more, slightly more robust snippets).

            I like the idea of doing more to help beginners figure things out for sure. I still have not figured out the precise best way to do it though.

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

            1 Reply Last reply Reply Quote 0
            • L Offline
              Larsen
              last edited by 20 Jan 2011, 17:28

              Tons of snippets are lying around, but few have 3D-SU goals/concept. What I would tell is that SU is specific for concepts relating to 3D expressions. Such concepts would first be enumerated: concept of rotating , concepts of translation, and so on. A master of SU-Ruby (I am keen to tell Gouru for their overwhelming production under rbs label --with some exceptions--) would express a concept with easyness parcimony, not at the hand of a novice. And then the motivated novice, I am sure will test the snippet, rearrange it and ONE day childbirth (!) snippets which will became a plugin NOT rbs one.
              Cogitations or Hallucinations, it's up to you to judge.

              I am ashamed to tell thanks for my ignorance.

              [Every form of thinking perish by excess of its basic principles.

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by 20 Jan 2011, 17:43

                You seen this: http://www.martinrinehart.com/models/tutorial/ ?

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • L Offline
                  Larsen
                  last edited by 20 Jan 2011, 20:42

                  Yes, I know the site of martinrinehart.

                  Thanks.

                  [Every form of thinking perish by excess of its basic principles.

                  1 Reply Last reply Reply Quote 0
                  • L Offline
                    Larsen
                    last edited by 20 Jan 2011, 21:03

                    I stumbled upon this post:

                    Ruby Script Video Tutorial - Multiple PushPull Script
                    Postby Chris Fullmer on Thu Nov 05, 2009 4:53 am
                    Hi, this video shows how to write a script the does a push/pull over many selected faces. Its about 10 lines of code, and I explain it in under 5 minutes. I could even be simplified down to 1 line of code really. But that is pretty dense code. So writing it in 10 lines is easier to read πŸ˜„

                    I would not have said it better.

                    Thanks Chris.

                    [Every form of thinking perish by excess of its basic principles.

                    1 Reply Last reply Reply Quote 0
                    • L Offline
                      Larsen
                      last edited by 20 Jan 2011, 21:15

                      Here another post by Chris who illustrate my idea (His idea).

                      BEGIN
                      Ruby Script Video Tutorial - add Construction Points
                      Postby Chris Fullmer on Fri Oct 30, 2009 5:39 pm
                      Ok, this is my first attempt at a real time, script writing tutorial. I might do another here shortly. I know some people are not fond of my videos, so I've done this to spite them πŸ˜„ And I've heard some people like the videos a lot, so those people are allowed to watch and listen.
                      But I warn you, this is Ruby scripting in real time. So its not super duper exciting, unless you like Ruby or want to learn to script.
                      It's only about 6 lines of code, so you can't get too confusedI hope.
                      END

                      You're RIGHT Chris.

                      What else.

                      [Every form of thinking perish by excess of its basic principles.

                      1 Reply Last reply Reply Quote 0
                      • D Offline
                        Dan Rathbun
                        last edited by 20 Jan 2011, 21:59

                        Sorry, but I'm really good at lurking.. πŸ˜›

                        Have you noticed my Ruby Newbie's Guide to Getting Started

                        which points at RUBY RESOURCES

                        I'm not here much anymore.

                        1 Reply Last reply Reply Quote 0
                        • L Offline
                          Larsen
                          last edited by 21 Jan 2011, 00:17

                          I am not talking about RUBY RESOURCES, but about perception process. By the way, do you know from whom we inherited lurking?

                          [Every form of thinking perish by excess of its basic principles.

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            Dan Rathbun
                            last edited by 21 Jan 2011, 03:16

                            @larsen said:

                            By the way, do you know from whom we inherited lurking?

                            @unknownuser said:

                            (http://dictionary.reference.com/browse/lurking )":27ob9p2a]

                            Origin:
                            1250–1300; ME lurken, freq. of lower2; cf. Norw lurka to sneak away

                            @unknownuser said:

                            (http://www.etymonline.com/index.php?search )":27ob9p2a]
                            ... probably from Scandinavian (cf. dial. Norw. lurka "to sneak away," dial. Swed. lurka "to be slow in one's work"), perhaps ult. related to M.E. luren "to frown, lurk"

                            So it probably came from Viking Norse, via Middle English, as a result of the Norse invasion into Britain (circa 875-950.)

                            I'm not here much anymore.

                            1 Reply Last reply Reply Quote 0
                            • T Offline
                              thomthom
                              last edited by 21 Jan 2011, 07:11

                              @dan rathbun said:

                              So it probably came from Viking Norse

                              😎 Grade 8 lurker

                              Thomas Thomassen β€” SketchUp Monkey & Coding addict
                              List of my plugins and link to the CookieWare fund

                              1 Reply Last reply Reply Quote 0
                              • H Offline
                                honoluludesktop
                                last edited by 21 Jan 2011, 07:22

                                Didn't read all of the above, how about this SketchUcation Topic ? Been there lots of time to look at stuff. Thanks to Jim!!!

                                1 Reply Last reply Reply Quote 0
                                • L Offline
                                  Larsen
                                  last edited by 21 Jan 2011, 21:55

                                  Very interesting link.

                                  http://jasonpaulgrant.co.uk/my-work/articles/42-is-lurking-a-problem.html

                                  [Every form of thinking perish by excess of its basic principles.

                                  1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    Dan Rathbun
                                    last edited by 21 Jan 2011, 22:37

                                    "snippet" does not mean 'small' ...

                                    ... it means some code that you can 'cut and paste' into your own code project.

                                    I'm not here much anymore.

                                    1 Reply Last reply Reply Quote 0
                                    • C Offline
                                      Cleverbeans
                                      last edited by 24 Jan 2011, 20:16

                                      @dan rathbun said:

                                      "snippet" does not mean 'small' ...

                                      If we're being pedantic then "snippet" is the diminutive of "snip" so it does in fact mean "a small portion of".

                                      1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        Dan Rathbun
                                        last edited by 24 Jan 2011, 23:40

                                        Ok fine.. I'll give ya that.

                                        But he wants a word that is smaller than small (limited to 10 lines.)

                                        How about pygmy code or pygmy snippet ??

                                        I'm not here much anymore.

                                        1 Reply Last reply Reply Quote 0
                                        • K Offline
                                          kwalkerman
                                          last edited by 27 Jan 2011, 18:04

                                          How about compiling a list of simple plugins that newbies can learn from? I find it is really helpful to learn from something that actually does something useful. We can develop a list of existing plugins, that are well-written, short, and accomplish something useful. I've learned alot from reading other people's code, and it definitely would've been useful to me to have a short list of plugins to download and learn from.

                                          I think that lots of people on this forum could develop a short list of their plugins that would help a beginner. This would provide an excellent resource without sapping TONS of time.

                                          --
                                          Karen

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          1 / 2
                                          • First post
                                            6/26
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement