sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    How to export model info as .csv files using ruby console?

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    5 Posts 3 Posters 574 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.
    • D Offline
      db11
      last edited by

      I want to be able to export (as .csv) simple lists of model info such as styles / scene names etc with a Ruby code snippet.

      I'm sure it must be quite straight forward, but I'm clueless with Ruby. (though I would like to start learning it).

      What I need at the moment is just a code stub that will generate the csv file from one class of model info — right now I need the style names — and I can swap out the different methods for other info once I understand the basics.

      Anyone have a starting point for me?

      Thanks,

      Doug

      1 Reply Last reply Reply Quote 0
      • oceanembersO Offline
        oceanembers
        last edited by

        I can't help you with the code, I don't know Sketchup's API very well at all, but as for a starting point for learning...

        Link Preview Image
        Learn Ruby the Hard Way - Read for Free46b0f5a81b40f11e9dbd77f12ebc2477-001-jinja.rst

        favicon

        (learnrubythehardway.org)

        I used this to learn the basics of ruby, and I thoroughly reccomend it.

        1 Reply Last reply Reply Quote 0
        • G Offline
          Garry K
          last edited by

          This script creates a simple plugin that traverses your model and creates a csv file


          csv from styles

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

            @garry k said:

            This script creates a simple plugin that traverses your model and creates a csv file

            That's great Gary — does exactly what I want. Many thanks,

            Doug

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

              @oceanembers said:

              I can't help you with the code, I don't know Sketchup's API very well at all, but as for a starting point for learning...

              Link Preview Image
              Learn Ruby the Hard Way - Read for Free46b0f5a81b40f11e9dbd77f12ebc2477-001-jinja.rst

              favicon

              (learnrubythehardway.org)

              I used this to learn the basics of ruby, and I thoroughly reccomend it.

              Starting to learn Ruby is on the to-do list once I'm through my current set of deadlines. Thanks for the link and the recommendation. I'll check it out.

              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