sketchucation logo sketchucation
    • Login
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Convert sketchup files to ruby

    Scheduled Pinned Locked Moved Developers' Forum
    20 Posts 6 Posters 2.0k Views 6 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 Offline
      wadhahmm
      last edited by

      hi
      if i use sketchup 7 for example,and I use the tools from menu and draw cube can i convert this drawing to ruby code (program)

      many thanks

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        No, not really. You can not reverse engineer a shape into ruby code.

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

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          @chris fullmer said:

          No, not really. You can not reverse engineer a shape into ruby code.

          Reverse engineering from a .skp into a .rb IS possible, but the programming effort required to find all of the skp's edges, faces, materials, layers, groups and components etc etc would be disproportionate compared with what you'd get. There are tools and methods available within ruby to make edges, curves, faces, pushpull, followme, add layers and materials etc etc ,that will do what you want without first making it in a skp and wrenching the info out of it.

          .

          TIG

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

            It's possible. Exporting a model as a Ruby file is a technique I thought of when thinking about how to connect and synchronize multiple instances of SketchUp over a network connection.

            Hi

            1 Reply Last reply Reply Quote 0
            • Chris FullmerC Offline
              Chris Fullmer
              last edited by

              I agree its possible to store all the entities into ruby. But I sort of get the feeling he wants an easy button that you can just click on and it will turn his shape into a script. So I was trying to be more realistic about what I am guessing he wants. But again, more info on the final purpose would be nice.

              @Jim, for the script, what if it was more of something like a database that stored the entity info. And then write a ruby that would just update the model by reading the database. Is something like that feasible?

              Chris

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

              1 Reply Last reply Reply Quote 0
              • W Offline
                wadhahmm
                last edited by

                Hi every body
                I hope you are fine.
                Can you show me any example for converting sketchup to ruby coiding,
                wadhah

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

                  @chris fullmer said:

                  @Jim, for the script, what if it was more of something like a database that stored the entity info. And then write a ruby that would just update the model by reading the database. Is something like that feasible?
                  Chris

                  Probably "required" is a better word to use than "feasable." I haven't really thought terribly deeply about it, but I would think a database would solve numerous issues that might arise from trying to synchronize SketchUps.

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • Chris FullmerC Offline
                    Chris Fullmer
                    last edited by

                    @wadhahmm said:

                    Hi every body
                    I hope you are fine.
                    Can you show me any example for converting sketchup to ruby coiding,
                    wadhah

                    How do you want the code to work? You want a script that will take a model, and then store that model into a ruby script. Then what? It does no good just sitting there in ruby. What do you plan on doing with it once its stored as "ruby". Is the script supposed to be able to then re-draw that shape on another computer's sketchup?

                    Chris

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

                    1 Reply Last reply Reply Quote 0
                    • TIGT Offline
                      TIG Moderator
                      last edited by

                      To take it to its logical conclusion you extract all of the skp data into a data file... That is in effect the skp file so why have you bothered ? You could for example extract only geometry - that's something like an exporter format... Simply take all of the edges and list their start and end XYZ with ref , all of the faces and list their edges refs. Then you could take the info into a ruby to build the geometry...

                      TIG

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

                        @tig said:

                        To take it to its logical conclusion you extract all of the skp data into a data file... That is in effect the skp file so why have you bothered ?

                        That's what I've been thinking as well. I think we need some clarification on the actual purpose of the original question. I could be that the question itself isn't correct.

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

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

                        Advertisement