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

    Joint locations-export/save

    Scheduled Pinned Locked Moved SketchyPhysics
    5 Posts 3 Posters 598 Views 3 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.
    • F Offline
      felderup
      last edited by

      is there a way... to move a joint, and export the position? how about several? dozens? seems something that would be useful... it'd be useful to me... it'd be good to export as either angle, or coordinates of the joints. i have something i work on that uses coordinates, instead of angle, and the hand editing of the file is not easy.

      1 Reply Last reply Reply Quote 0
      • M Offline
        Mr.K.1
        last edited by

        Well give us a format example, getting positions and joint data is dead simple you only need to say how you want it presented, then I can make you a rough example.

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

          Mr. K...I could muster some of what was requested but this generated more questions than answers. Could you also add in some insight on how the definitions of what is attached to what are stored in the data structures(connects to ???). I am trying to learn Ruby both as it works in sketchup but also more powerfully in how it works in Sketchy Physics. Thanks heaps.

          1 Reply Last reply Reply Quote 0
          • M Offline
            Mr.K.1
            last edited by

            Well I wrote a bit more on this here: http://sketchyphysicscommunity.webs.com/apps/forums/topics/show/1568658-su-advanced-scripting
            And the SU API is a great resource of extras:http://code.google.com/intl/sl/apis/sketchup/docs/classes.html

            So to this particular problem:

            • first you need a list of all objects in the model
              entities = Sketchup.active_model.entities

            • then you check if the object is a group/component(the only ones important in SP)
              ent1 = entities[0]
              if ent1.class==Sketchup::Group or ent1.class==Sketchup::ComponentInstance

            • and then you read the attributes SP uses to store joint data and connections
              joint_name = ent1.get_attribute("SPJOINT","name")
              If it isn't a joint this will just return nil, and if it is you can read anything you want.
              ent1.get_attribute("SPJOINT","type")
              ent1.get_attribute("SPJOINT","min")
              ent1.get_attribute("SPJOINT","max")
              ent1.get_attribute("SPJOINT","damp")
              ...

              Best way to actually view all these is with the attribute manager plugin:
              http://code.google.com/p/sketchupattributemanager/downloads/list

            1 Reply Last reply Reply Quote 0
            • F Offline
              felderup
              last edited by

              i just wanted to bang out some kind of list i could use to turn into an imvu pose. there's already an imvu exporter, perhaps pausing and exporting current position would do it...

              [ed] yaknow... if it worked, and the positions could be played back, it'd give sketchup a fully functioning keyframe animation system. i can't remember if it's been done yet, or i wouldn't mention it.

              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