sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Best way to recreate the model database?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 483 Views 2 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.
    • M Offline
      mtalbott
      last edited by

      Hi, all. I'm working on a script that has to recreate the sketchup model database outside of sketchup (ruby console app on a remote server). I am struggling with the best way to do it for best performance/flexibility. one constraint is that I can only communicate with the external app through Strings. Also, I am not using the import/export SDK because this is for real-time communication so I am using observers to notice changes and update the external model several times a second. The external model is for many things e.g. versioning/history records, multiple users, complex visibility controls, browser viewer with webgl, and a few others.

      how would you do it?

      1. Hash: The way I'm doing it right now is with nested hashes. a single message might look like this {time.now =>{"edge" => {id_number => {start_pt, end_pt}}}}. I pass it back and forth with .inspect and eval() to make it a string. I then take the new message and use it to .update a mega hash overwriting old info or adding new info. it works but the hashes are several levels deep and I don't know if there are going to be performance issues.

      2. JSON: this would be the same as a hash just modifying the string to be JSON. The benefit of this might be using it with existing webGL libraries or anything web related but i don't really know.

      3. MySQL or some other database: with a real database I could organize the information better in tables but I don't know if queries would be faster or slower than looking up in a hash. Also, it's just one more layer of technology to use/learn.

      4. XML: I could write changes out to some XML format like collada or IFC. not sure how I would update the xml but maybe it's possible. Also, worried about quick look-ups with XML.

      5. Something I haven't thought of.

      Thanks,
      -Mike

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

        (I know, old post.)

        How's the project coming along?

        I'm not sure there would be much of a performance difference between the mentioned formats. If history is important, a proper database seems like a good choice for persistent storage and support of transactions. Instead of "real-time", maybe sending the messages as some kind of "Transaction" after each operation completes would work better.

        The other thought I had was that creating a set of simplified drawing tools that generate the Transaction messages as they complete might be easier than trying to use Observers to capture all the activity generated by SketchUp as it happens.

        Hi

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

          @jim said:

          How's the project coming along?

          Unfortunately, it's not coming along very much at all. just been too busy to code (which is my hobby, not my job). The initial goal was to make a server-base sketchup environment so that multiple people could work on a model at the same time. However, my eyes got bigger than my abilities and I started dreaming of a completely new way to collaborate, document, and communicate 3-dimensional information. I got a little overwhelmed when I starting looking into webGL and thought that it would be amazing if there would be a way to put sketchup modelings into a browser webGL viewer similar to google's body browser:http://bodybrowser.googlelabs.com/body.html#. Since then I am cooling the programming jets to write a white paper on the future of architectural documentation and what the technology required for an all-digital design/build environment might look like.

          Thanks for the advice on my previous post. I will be getting this project going again hopefully very soon.

          -Mike

          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