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

    Controle Servos External

    Scheduled Pinned Locked Moved SketchyPhysics
    10 Posts 4 Posters 1.6k Views 4 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.
    • R Offline
      ripper121
      last edited by

      How can i controle servos with other programs?
      Is ther a API or can i import with a script CSV or INI files?

      I have test a Ruby code for file reading in the UI but it crash.

      1 Reply Last reply Reply Quote 0
      • M Offline
        mptak
        last edited by

        I'll try and follow-up with a better post but if look at webdialogs and getting ruby to talk to javasript which can make ajax calls you might find your answer. I am doing the same to animate data from an SQL database into a regular sketchup animation so servos should be no different. This may become easier if Sketchup incorporates the a more fully functional Ruby as has been hinted at. Websockets would make this much easier.

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

          Can you send me pleas the source?
          Ripper121 [at] gmail.com

          1 Reply Last reply Reply Quote 0
          • M Offline
            mptak
            last edited by

            Link Preview Image
            Sharing data between SketchUp Ruby and Javascript

            Posted by Scott Lininger, SketchUp Software Engineer If you are building rich WebDialogs in your SketchUp Plugin, then you are probably usin...

            favicon

            (sketchupapi.blogspot.com)

            http://www.martinrinehart.com/models/rubies/ruby2javascript_javascript2ruby.html

            This post by the illustrious Martin Rinehart as well as Scott L. gets you most of the way and then the code looks something like this

            In the servo value field place this getVar("@@servovalue") #yes you need the quotes

            #Try and avoid global variables and somehow using the getVar and setVar functions makes things crash a little less.

            In the callback function set an instance variable like @@servovalue1 = callbackarray[1] #the callback returns a string
            #so you need to deal with
            #the sub values

            In reality this can all be done without using the ontick function with the variable value update period being controlled by the setTimer function in the javascript. This give a bit of a choppy simulation as it pauses to get the values from the sql database but if you capture the animation frames you should be able to take the choppiness out.

            I'll clean up what I have built on some suggestions and insights from folk like Mr. K and try to post something less cryptic.

            http://sketchucation.com/forums/viewtopic.php?f=61&t=38368 is a link back to some work just pulling from a file.

            Ciao.

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

              Thx 😄
              But the second link is down.

              1 Reply Last reply Reply Quote 0
              • M Offline
                mptak
                last edited by

                Try again. Worked for me this morning. Perhaps the server was down.

                In general I find Mr. Rinehart's Edges to Rubies one of the goto books even if it doesn't specifically target Sketchy Physics.

                1 Reply Last reply Reply Quote 0
                • ashscottA Offline
                  ashscott
                  last edited by

                  May or may not be relevant but simfonia animation tools does CSV input which I think is severely underutilized in other sketchup plugins

                  Ash

                  Just some stuff I do with Sketchup.

                  1 Reply Last reply Reply Quote 0
                  • ashscottA Offline
                    ashscott
                    last edited by

                    Servo is an actuator (like in a radio controlled plane) but in this instance it is a virtual servo used in the physics plugin "sketchyphysics"

                    Just some stuff I do with Sketchup.

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      mptak
                      last edited by

                      I must say that simfonia was pretty impressive at BaseCamp 2012. I think I'll have to dive back into that first chance I get.

                      1 Reply Last reply Reply Quote 0
                      • SimFonIA_teamS Offline
                        SimFonIA_team
                        last edited by

                        Hello Mptak,

                        As Ashscott suggests (thank you!), you should find your happiness with our plugin. You will indeed quickly be able to drive transformations of your choice (rotation, translation, visibility, color, position ...) from data contained in a CSV file.

                        Do not hesitate to ask me your question, for now I suggest you download the trial version and try the quick-start guide (http://www.simfonia.fr/SAT/index.php?page%20=%20&%20PHPSESSID%20=%20r5d5vdo38o0taei07aaqaj9j04%20documentation)

                        P.S: what is a servo? Is this an actuator such as in radio control plane?

                        Give life to your ideas : http://www.simfonia.fr/SAT/

                        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