sketchucation logo sketchucation
    • Login
    1. Home
    2. Bas9999
    3. Topics
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    B
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 20
    • Groups 1

    Topics

    • B

      Stop simulation immediatly / End script!

      Watching Ignoring Scheduled Pinned Locked Moved SketchyPhysics
      3
      0 Votes
      3 Posts
      7k Views
      B
      Hi Anton_S Thank you, so this is the piece of code i have now... wich includes a messagebox to ask the COM port and exit if CANCEL is pressed. The code is lumped together with some examples found here and there, so if there are any tweaks let me know! [image: okRG_spsu15serialrecieveexample.png] # DomoticX Virtual 3D Device Port SU15 interface. # Wat moet er gebeuren bij het starten van de simulatie? onstart{ options = ["Serial Port;", "Baudrate;"] default = ["COM8", "9600"] list = ["", "4800|9600|14400|19200|28800|38400|57600|115200"] serialsettings = UI.inputbox(options, default, list, "Serial port settings;") if serialsettings != FALSE $comport = serialsettings[0] $baudrate = serialsettings[1].to_i begin @serial = Serial.new($comport, $baudrate) rescue RubySerial;;Exception => e @serial.close if @serial MSketchyPhysics3;;SketchyPhysicsClient.physicsReset UI.messagebox("Serial port not found!") end else MSketchyPhysics3;;SketchyPhysicsClient.physicsReset end } # Wat moet er gebeuren tijdens de simulatie? ontick{ MSketchyPhysics3.closeControlPanel if frame == 1 string_size = 1024 $serialdata = eval(@serial.read(string_size)) logLine("COM poort; " + $comport.to_s) logLine("BAUD rate; " + $baudrate.to_s) logLine("Seriele data; " + $serialdata.to_s) logLine("") logLine("") logLine("") logLine("") logLine("") } # Wat moet er gebeuren als de de simulatie stopt? onend{ # Sluit de seriele poort als deze open staat. @serial.close if @serial } Ps. The simulation works fine... but sometimes when i STOP and START the simulation again i get this error, when i start it for the second time it works perfectly again, any ideas to prevent this? [image: 1T84_spsu15serialrecieveerror.png]
    • B

      Write to serial port with Ruby [SOLVED!]

      Watching Ignoring Scheduled Pinned Locked Moved SketchyPhysics
      19
      0 Votes
      19 Posts
      20k Views
      T
      I have found the answer. It is ffi gem crashing in Win10 in SU2017...18...19 https://forums.sketchup.com/t/sketchup-2017-crashes-when-ffi-is-loaded-in-windows-10/40372
    • B

      Read out hinge/servo value [SOLVED!]

      Watching Ignoring Scheduled Pinned Locked Moved SketchyPhysics
      15
      0 Votes
      15 Posts
      9k Views
      B
      Thank you Anton_S! @All, Watch the YouTube movie where i used these scripts in action: https://www.youtube.com/watch?v=aMCL08xONZs SCRIPTS & TUTORIALS @ DomoticX.com Look for: "Virtual 3D Device Port" [image: dXOg_Virtual-3D-Device-port-SU08-logo.jpg] The tutorial pages are written in our main language: DUTCH Use google translate to translate the pages for you! (note: copy & paste scripts from the original untranslated site)
    • 1 / 1