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

    MSPhysics tests and questions

    Scheduled Pinned Locked Moved Plugins
    104 Posts 21 Posters 44.7k Views 21 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.
    • A Offline
      Anton_S
      last edited by

      tecnozati,

      Yeah, the docs do not have enough coding examples. But I intended to fix that someday.

      To get the position of a servo joint from a script field, you will first need to know the name/id of the joint, which is displayed in UI when you select the joint. Then you can write the following code:

      
      onStart {
        @j = simulation.find_joint_by_name("569422")
      }
      
      onTick {
        # Set desired angle
        if (key(' ') == 1) 
          @j.controller = 100.degrees
        else
          @j.controller = 0
        end
        
        # Get current angle
        simulation.log_line @j.cur_angle.radians
      }
      
      

      You can refer to servo docs for more functionality: https://www.rubydoc.info/github/AntonSynytsia/MSPhysics/MSPhysics/Servo

      Anton

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

        😮 😮 Thank you, thank you, thank you! The head was going to burn me!
        And above all, thanks for Msphysics! 👍

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

          Again, thanks Anton, I have managed to give life to my creature 😉

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

            Dude great job!!!

            1 Reply Last reply Reply Quote 0
            • P Offline
              pppppppppppppppppppppppppppppluginuser
              last edited by pppppppppppppppppppppppppppppluginuser

              I have made a simple car and set a controller for the servos and motors but they don't respond. Any clue on how to fix? (controls are the arrow keys)


              Motor ui


              Servo ui


              Simple car


              Car Simulation.skp

              1 Reply Last reply Reply Quote 0
              • ecatiE Offline
                ecati
                last edited by

                If you upload the skp file, we can have a look.

                1 Reply Last reply Reply Quote 0
                • ecatiE Offline
                  ecati
                  last edited by

                  It works perfectly. I didn't see any problem.
                  Click on the picture for animation.


                  test.gif

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    pppppppppppppppppppppppppppppluginuser
                    last edited by

                    It might be something with my wrong with either my computer, msphysics, or sketchup because I start the simulation and the car starts driving by itself and doesn't respond to the the arrow keys.

                    Also is there a plugin that downloads the simulation recording?

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      pppppppppppppppppppppppppppppluginuser
                      last edited by

                      Never mind I just needed to uninstall MS physics and AMS library and get the extensions from the SketchUp extension warehouse. Just a final question, what plugin downloads the simulation recording?

                      1 Reply Last reply Reply Quote 0
                      • BoxB Offline
                        Box
                        last edited by

                        A small hint, I suspect nobody has bothered to reply or read your posts due to your spam style user name. I only came here by accident.

                        Like most things in life there is 'Unique' and there is 'wtf'. try being unique.

                        1 Reply Last reply Reply Quote 0
                        • Rich O BrienR Online
                          Rich O Brien Moderator
                          last edited by

                          I fixed it to be less obnoxious.

                          Download the free D'oh Book for SketchUp 📖

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

                            Bonjour, je n'ai également pas la possibilité de commander les animations (Thruster, Emetter, etc..) avec le clavier de mon portable, je ne suis pas le premier à relever ce problème apparemment et je ne trouve pas la solution. Avez-vous une idée svp ?

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

                              @ecati said:

                              It works perfectly. I didn't see any problem.
                              Click on the picture for animation.

                              • English: Hello, I can't get the keyboard commands to work either. I am using a drinking PC with Windows 11, sketchup 2018 and I have installed the ams_Lib.rbz_v3.7.1b.rbz library and MSPhysics_v1.0.3.rbz. The problem is the same on my other laptop running Windows 10. Can you help me? Thank you in advance.
                              • Français: Bonjour, chez moi non plus, je n'arrive pas à faire fonctionner les commandes au clavier. J'utilise un PC potable avec Windows 11, sketchup 2018 et j'ai bien installé la librairie ams_Lib.rbz_v3.7.1b.rbz ainsi que MSPhysics_v1.0.3.rbz. Pour info le problème est identique sur mon autre PC portable équipé de Windows 10. Pouvez-vous m'aider? D'avance, merci.
                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                DanyLecocq
                                last edited by

                                @ecati said:

                                It works perfectly. I didn't see any problem.
                                Click on the picture for animation.

                                Hello, I can't get the keyboard commands to work either. I am using a drinking PC with Windows 11, sketchup 2018 and I have installed the ams_Lib.rbz_v3.7.1b.rbz library and MSPhysics_v1.0.3.rbz. The problem is the same on my other laptop running Windows 10. Can you help me? Thank you in advance.
                                Bonjour, chez moi non plus, je n'arrive pas à faire fonctionner les commandes au clavier. J'utilise un PC potable avec Windows 11, sketchup 2018 et j'ai bien installé la librairie ams_Lib.rbz_v3.7.1b.rbz ainsi que MSPhysics_v1.0.3.rbz. Pour info le problème est identique sur mon autre PC portable équipé de Windows 10. Pouvez-vous m'aider? D'avance, merci.

                                1 Reply Last reply Reply Quote 0
                                • I Offline
                                  i-ss
                                  last edited by i-ss

                                  Hello Anton or Anyone who could explain me for the problem.

                                  I've use SketchUp 2017 for long time together with MSPhysics (right now is version 1.0.3).
                                  They worked well and thank you very much to Anton that create a super good extension.

                                  But suddenly, the models that I using with MSPhysics has problems on running scripts that has user interaction such as using keys and mouse buttons. Everytime I run the script, it pop a window like shown here.

                                  https://i.postimg.cc/kgkQ6z8x/Screen-Shot-10-26-23-at-01-24-AM.png

                                  https://i.postimg.cc/6QMB1J0Z/Screen-Shot-10-26-23-at-01-25-AM.png

                                  I think, my problem is the same like "DanyLecoeq" and "hmau26" that they've posted before.

                                  https://i.postimg.cc/sDv7qXmj/Screen-Shot-10-26-23-at-10-18-AM.png

                                  1 Reply Last reply Reply Quote 0
                                  • I Offline
                                    i-ss
                                    last edited by

                                    @i-ss said:

                                    Hello Anton or Anyone who could explain me for the problem.

                                    After long period of waiting. I've try to down-version of ams_lib from v3.7.1b (the last one, I think) to v3.5.2

                                    Then all back to work !!!

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

                                    Advertisement