sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    What if we could use <blank>?

    Scheduled Pinned Locked Moved Developers' Forum
    63 Posts 17 Posters 3.6k Views 17 Watching
    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.
    • J Offline
      jessejames
      last edited by jessejames

      πŸ’­

      If you had a choice -- hypothetically -- what programming language would you prefer to script SU with? Would you stick with Ruby or use another. This is a morbid curiosity of mine.

      I'll let you guys give your opinions. Any language is on the table here, so let the voting begin.

      My Vote: Python πŸ‘

      Always sleep with a loaded gun under your pillow!

      1 Reply Last reply Reply Quote 0
      • R Offline
        Ross Macintosh
        last edited by

        JJ I know this isn't what you had in mind here but how about some sort of object oriented language with a drag'n drop interface. My young son (then about ten) used to program with 'Alice'. It was object oriented. If Sketchup scripts could be put together like that, then perhaps non-programmers (like me) could get into script creation.

        1 Reply Last reply Reply Quote 0
        • J Offline
          jessejames
          last edited by

          Hello Ross,
          Yea, Blender has something like this so i know what you mean. Although you will be limited to what you can do in a system like that.

          From your words it seems you would like to program but have not found a language that entices you. Have you looked at the Python Programming language? Most non-programmers find it very easy to pick up. Python takes a common sense approach to programming.

          Actually Python and Ruby are equals in power, but they differ drastically in syntax and readability. Python allows for true procedural AND true OOP programming. Typically a student will find that learning basic programming principals thru a procedural approach is much easier. Then they can ease their way into OOP. OOP is not hard to understand, but taking on both at the same time is quite a daunting task.

          I will even personally tutor you. I guarantee i could teach you to program in a very short period of time, and you will love it.(if you really want to)

          You may wonder what it takes to be a programmer. I will tell you the secret -- Programming is perpetual problem solving -- The only skill you need is an ability to problem solve and a passion to solve problems.

          If you are interested in that tutoring i am not kidding, send me a PM.

          Ross's Vote: Alice

          Always sleep with a loaded gun under your pillow!

          1 Reply Last reply Reply Quote 0
          • R Offline
            remus
            last edited by

            Are you a fan of python by any chance? πŸ˜„

            http://remusrendering.wordpress.com/

            1 Reply Last reply Reply Quote 0
            • PixeroP Offline
              Pixero
              last edited by

              How about a thread with ruby programming tutorials for everyone? πŸ€“

              1 Reply Last reply Reply Quote 0
              • T Offline
                todd burch
                last edited by

                OK, I'll bite.

                C++.

                For processing intensive scripts, the speed would be awesome.

                Todd

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  @unknownuser said:

                  OK, I'll bite.

                  C++.

                  For processing intensive scripts, the speed would be awesome.

                  Todd

                  Now that'd be interesting.

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

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    I wouldn't be writing SU plugins if it's been C++. I've tried to get my head around it before, but with no great success. But I still think it'd be interesting with C++ plugins with the potential for increased speed.

                    As for my own preference of script language; I'm not picky. Script languages doesn't seem too hard to pick up once you've learnt one. I had previous experience in JS and PHP scripting. (Some Visual Basic and C# programming as well) Getting into ruby only took a weekend to get me started writing the scripts I wanted. Though I'm still learning new ways the Ruby language works as oppose to what I've used before.

                    I find the API and documentation of the API much more important. And I feel that the SU API documentation have lots of room for improvement.

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

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      todd burch
                      last edited by

                      C++ code - no big thang!!

                      #include <iostream>
                      int main() {
                      	std;;cout << "Hello World!" << std;;endl ; 
                      	return(0);
                      }
                      

                      Ruby

                      
                      def cout ; 
                         STDOUT << "Hello World!" ; 
                         return ; 
                      end 
                      cout ;
                      
                      

                      I don't do Python. 🀒

                      πŸ’š

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        todd burch
                        last edited by

                        I've done it all... I'd just be showing off. 🀣

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          jessejames
                          last edited by

                          @unknownuser said:

                          C++ code - no big thang!!
                          I don't do Python. 🀒

                          With Python not only is it "no big thang"
                          There is no "THANG" at all!

                          
                          print 'Hello World' 
                          
                          

                          sorry Todd, but that was a πŸ‘Š
                          (big one's really do fall harder!)

                          PS: That Ruby code could have been better
                          PPS: Do you want to try file I/O next ??

                          Always sleep with a loaded gun under your pillow!

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            todd burch
                            last edited by

                            I code in several languages, and Python is not one of them. Therefore, I can't be held accountable for knowing the ins and outs of it. I have nothing against Python (sans the 🀒 comment πŸ˜‰ ), it's just not something I want to invest my time in.

                            On that same list is learning how to wallpaper and ballroom dance. 🀒 🀒

                            1 Reply Last reply Reply Quote 0
                            • J Offline
                              jessejames
                              last edited by

                              WOW!, your comments show a deep seeded hatred for Python. Where is this coming from Todd?

                              Always sleep with a loaded gun under your pillow!

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                david.
                                last edited by

                                I'm having difficulty finding any major differences between Python and Ruby. The "Hello World" example you cited can be coded exactly the same in Ruby. There are tutorials and references on Ruby, one of which is Programming Ruby. As one that has done a lot of C, to name one, I don't find that Ruby is a difficult language to learn. I don't think that a non-programming will find much difference between learning Ruby or Python. Python is open source, yada, yada, yada..., well, so is Ruby. You make it sound a lot worse than reality. Ruby is not simply derived from Perl, it has also borrowed from Eiffel, Smalltalk, Lisp, and Ada.

                                For the most part, I'm with Todd on this... why introduce another programming API into SU? It's not worth the effort. The quality of the SU Ruby API documentation has nothing to do with the choice of Ruby. It has everything to do with taking the time to produce. As in most software projects, documentation is generally the lowest priority on the schedule. That's certainly the case for the SU Ruby API. If Python had been chosen as the SU programming API, then I'd be in favor of keeping it. But, it wasn't. Do you think it would be a good investment of time to create another programming API for SU when one already exists? There would be double the documentation requirements and that doesn't include the added development/support requirements and code bloat. It seems very little value added for such an increased effort.

                                1 Reply Last reply Reply Quote 0
                                • H Offline
                                  herodes
                                  last edited by

                                  I am gonna have to suggest Lua on this.
                                  The language's ability of being "a powerful, fast, light-weight, embeddable scripting language", is really what it sounds.

                                  Lua does functional programing, which is great for non programers if you combine it with the amazingly simple syntax. Also Lua has enough all the sleeves to pull all the cards you'd probably want from a scripting language. You can even do oop... and still be fast!

                                  Many programs have been using it as their scripting language either for adding functionality or simply automating the host program. An easy example is Ecotect.

                                  %(#BFBFBF)[http://arhitektonas.blogspot.com
                                  I know me,... I am that guy...
                                  ]

                                  1 Reply Last reply Reply Quote 0
                                  • T Offline
                                    todd burch
                                    last edited by

                                    @jessejames said:

                                    WOW!, your comments show a deep seeded hatred for Python. Where is this coming from Todd?

                                    You are going down a dead end road, JJ. I don't know Python. I don't know how to wallpaper. I don't know how to ballroom dance. I don't know you. I hate none of the above. As it stands rights now, of the above, the only one I would care to learn about would be you!

                                    1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      avariant
                                      last edited by

                                      I'm not much of a script programmer, my experience is mostly in c++ and c#. My forays into ruby are really my first experience with script languages. Not experiencing other choices, I'd have to pick ruby. I like that you can inherit classes; I don't like that it's a little to loose when it comes to that πŸ˜‰. I really like how easy it is to extend ruby with c and c++, and the tools available in c to communicate with ruby. I hate ruby's garbage collection (but that's only an issue when extending in c/c++). So good and bad, but having nothing to compare it against, I say it's good enough. πŸ˜„

                                      Avariant's pick: Ruby

                                      1 Reply Last reply Reply Quote 0
                                      • J Offline
                                        jessejames
                                        last edited by

                                        @unknownuser said:

                                        @jessejames said:

                                        WOW!, your comments show a deep seeded hatred for Python. Where is this coming from Todd?

                                        You are going down a dead end road, JJ. I don't know Python. I don't know how to wallpaper. I don't know how to ballroom dance. I don't know you. I hate none of the above. As it stands rights now, of the above, the only one I would care to learn about would be you!

                                        Hello again Todd,
                                        So you want to get to know me eh? A little chit chat? Ask away, these are free and open forums ASAIK πŸ’š

                                        Always sleep with a loaded gun under your pillow!

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          david.
                                          last edited by

                                          JJ, some of your comparisons are clearly misleading. I haven't seen one thing that Python does that Ruby doesn't. The grammar may be slightly different, but they do the same thing (including "list comprehension"). Ruby has the identical functionality, but the syntax is different. You're wasting time as far as I'm concerned. This is a "religious" argument and your "religion" is Python. Threads like this will not end in anything but wasted time and hard feelings.

                                          1 Reply Last reply Reply Quote 0
                                          • J Offline
                                            jessejames
                                            last edited by

                                            @david. said:

                                            ... Ruby is not simply derived from Perl, it has also borrowed from Eiffel, Smalltalk, Lisp, and Ada.

                                            And the best things about Ruby are borrowed from Python.

                                            @unknownuser said:

                                            1Q.)For the most part, I'm with Todd on this... why introduce another programming API into SU? It's not worth the effort. The quality of the SU Ruby API documentation has nothing to do with the choice of Ruby. It has everything to do with taking the time to produce. As in most software projects, documentation is generally the lowest priority on the schedule. That's certainly the case for the SU Ruby API. If Python had been chosen as the SU programming API, then I'd be in favor of keeping it. But, it wasn't.
                                            2Q.)Do you think it would be a good investment of time to create another programming API for SU when one already exists? ...

                                            These are all good questions and i will give good answers for them.

                                            1A.) Look, an API is for users to wield the full power of an application(or maybe just automate a simple task), not so a few at the top can make money writing scripts because the language is poorly documented and overly complicated.

                                            I have nothing against the professionals who want to write professional plug-in/scripts. But at least give the users of that application the common sense tools they need to get their scripting done, so don't handicap them with a poor language choice (Ruby)

                                            I want to give every SU user the ability to write useful scripts for them selfs. My number one complaint about Ruby is Poor documentation. Ruby has no good free introductory tutorials. But Python has tons and tons of good free tutorials that cover vast amounts of programming tasks. At the following link, there are 300+ Python tutorials listed in more than 50 Categories, and this is just one site!!!

                                            300+ tuts
                                            http://www.awaretek.com/tutorials.html

                                            Here is a list of nonprogrammer tuts:
                                            http://wiki.python.org/moin/BeginnersGuide/NonProgrammers

                                            Here is a list of experienced programmer tuts:
                                            http://wiki.python.org/moin/BeginnersGuide/Programmers

                                            Ruby cannot touch the amount of good docs available for Python.

                                            2A.) Yes, i absoulty think bringing in Python -- even next to Ruby -- would be a great idea. This would give all SU users the power they need. Not only do i think this is a great idea, i am willing to spend my time(free of charge)to make this happen. Even if i have to do it completely alone. That is my commitment! I have no will to make capital gains on the SU users. My goal is to extend their SU experience.

                                            I plan write an introductory tut specifically targeted at SU users with no programming experience for SU Python scripting. Not only that, i plan a much better console for SU. You may say, why do we need a better console, a console is only good for trying out short pieces of code. I say Yes, this is exactly how a n00b learns. They type a command and see the results right away. The single line console in SU is almost useless and could easily be improved. Noobie's have a problem understanding how to format code to fit on one line.

                                            
                                            Skethchup.active_model.selection[0].offset(-3)
                                            
                                            

                                            or this

                                            
                                            def f;for x in model.selection; x.this;x.that;end;end
                                            
                                            

                                            All that does is serve to frustrate and defeat the user before they have a fighting chance. A multi-line console will ease the learning curve.

                                            PYTHON GUI
                                            Also Python has a built-in GUI(Tkinter). Tkinter is a very easy to use GUI toolkit, which contains all the main widgets a GUI needs, built right into the language. How would you like to have that on board for ya scripting pleasure, eh?

                                            here is a Tkinter program that contains a button widget

                                            
                                            from Tkinter import *
                                            root = Tk()
                                            def call(); print 'Hello SketchUp'
                                            Button(root, text='Press Me', command=call).pack()
                                            root.mainloop()
                                            
                                            

                                            That short piece of code creates a main window with a button that prints 'Hello SketchUp'.

                                            Look, i want to improve this great software for everyone. The more people we have coding, the more ideas and improvements we can bring to SU. Let's empower all SU users!!

                                            Always sleep with a loaded gun under your pillow!

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

                                            Advertisement