sketchucation logo sketchucation
    • Login
    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!
    โš ๏ธ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

    Code Profiling

    Scheduled Pinned Locked Moved Developers' Forum
    28 Posts 8 Posters 6.1k Views 8 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.
    • W
      Whaat
      last edited by

      Would anyone be willing to provide a code snippet showing a trivial example of using C in combination with Ruby? I am still feeling kind of lost about how I could pass information back and forth between the two languages.

      SketchUp Plugins for Professionals

      1 Reply Last reply
      Reply Quote 0
      • tbdT
        tbd
        last edited by

        Whaat: a ruby c extension or a SU SDK one ?

        SketchUp Ruby Consultant | Podium 1.x developer
        http://plugins.ro

        1 Reply Last reply
        Reply Quote 0
        • W
          Whaat
          last edited by

          @unknownuser said:

          Whaat: a ruby c extension or a SU SDK one ?

          Whatever is the simplest.... ๐Ÿ˜„ Even a 'hello world' example would be a good start.

          SketchUp Plugins for Professionals

          1 Reply Last reply
          Reply Quote 0
          • tbdT
            tbd
            last edited by

            the simplest is ruby extension and I showed you a link some time ago. didn't worked ?

            to use SU SDK for a simple .skp page parser I made a small 8kb exe that needed 8.92 MB of .DLL files ๐Ÿ˜ฎ

            SketchUp Ruby Consultant | Podium 1.x developer
            http://plugins.ro

            1 Reply Last reply
            Reply Quote 0
            • W
              Whaat
              last edited by

              @unknownuser said:

              the simplest is ruby extension and I showed you a link some time ago. didn't worked ?

              Heh...I never tried it because I got scared of the makefile stuff...

              What interests me much more is Rubyinline. Look at the comment posted just below the blog post at the link you are referring to.

              Do you think Rubyinline can be used with SketchUp? I see that it requires rubygems so this (and Rubyinline) would have to be distributed with the plugin as I see it.

              SketchUp Plugins for Professionals

              1 Reply Last reply
              Reply Quote 0
              • tbdT
                tbd
                last edited by

                @whaat said:

                Do you think Rubyinline can be used with SketchUp? I see that it requires rubygems so this (and Rubyinline) would have to be distributed with the plugin as I see it.

                no. RubyInline is just a shortcut for building extensions - you still need to have a compiler on that machine to make it work.

                I also had problems make it run on my Windows machine as it doesn't like paths with spaces (v 3.6.3) and also it uses deprecated options for VC.

                get started with that link, makefiles are peanuts compared with COM and finding problems in RubyInline ๐Ÿ˜‰

                SketchUp Ruby Consultant | Podium 1.x developer
                http://plugins.ro

                1 Reply Last reply
                Reply Quote 0
                • W
                  Whaat
                  last edited by

                  @unknownuser said:

                  get started with that link, makefiles are peanuts compared with COM and finding problems in RubyInline ๐Ÿ˜‰

                  Thanks! I will definitely try this at some point.

                  So, other than having full Ruby installed and a development environment such as PellesC, is there anything that needs to be done for this to work?

                  I would still love to see an actual SketchUp related example where you pass values from Ruby to the C extension and then back again.

                  SketchUp Plugins for Professionals

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

                    If you ever saw SimuTerra, that was an an app that was made into a C extension from Ruby. As far as I am aware, it suffered from none of the issues mentioned by Adam. It was blazingly fast to manipulate terrains with SimuTerra. (sp?)

                    1 Reply Last reply
                    Reply Quote 0
                    • tbdT
                      tbd
                      last edited by

                      Whaat: I created a simple extension that creates a class SUExt with method add which adds 1 to the input at http://bitbucket.org/tbd/suext/src/

                      there are no error checking and it is a minimal example that compiles with PellesC (free C compiler) and it can be used in SketchUp

                      have fun

                      SketchUp Ruby Consultant | Podium 1.x developer
                      http://plugins.ro

                      1 Reply Last reply
                      Reply Quote 0
                      • W
                        Whaat
                        last edited by

                        @unknownuser said:

                        Whaat: I created a simple extension that creates a class SUExt with method add which adds 1 to the input at http://bitbucket.org/tbd/suext/src/

                        there are no error checking and it is a minimal example that compiles with PellesC (free C compiler) and it can be used in SketchUp

                        have fun

                        Thanks so much for taking the time to do this!

                        SketchUp Plugins for Professionals

                        1 Reply Last reply
                        Reply Quote 0
                        • T
                          tomasz
                          last edited by

                          @whaat said:

                          Thanks so much for taking the time to do this!

                          +1!

                          Author of Thea Render for SketchUp

                          1 Reply Last reply
                          Reply Quote 0
                          • J
                            Jim
                            last edited by

                            I thought you were a github man?

                            Hi

                            1 Reply Last reply
                            Reply Quote 0
                            • tbdT
                              tbd
                              last edited by

                              @unknownuser said:

                              I thought you were a github man?

                              I like more github as a repository site but I like even more Mercurial as DVCS ๐Ÿ˜‰ and I was lazy to create a bridge to git using hg-git

                              SketchUp Ruby Consultant | Podium 1.x developer
                              http://plugins.ro

                              1 Reply Last reply
                              Reply Quote 0
                              • J
                                Jim
                                last edited by

                                I tried once to see it was possible to use the same folder for both systems. I just set each one to ignore the repos and configs of the other. It appeared to work; at least in my simple test folder.

                                I tried and hg-git also, although it took some extra installation and setup. It also seemed to work just fine, although I had more warnings than I cared for - made me nervous.

                                Hi

                                1 Reply Last reply
                                Reply Quote 0

                                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                With your input, this post could be even better ๐Ÿ’—

                                Register Login
                                • 1
                                • 2
                                • 2 / 2
                                • First post
                                  Last post
                                Buy SketchPlus
                                Buy SUbD
                                Buy WrapR
                                Buy eBook
                                Buy Modelur
                                Buy Vertex Tools
                                Buy SketchCuisine
                                Buy FormFonts

                                Advertisement