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

    Automating Sketchup from Excel

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 4 Posters 6.5k Views 4 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
      filcole
      last edited by

      Hi All,

      I'm wondering if anyone has managed to automate Sketchup from Excel. I have a list of components and dimensions thereof in Excel, and I want to click a button in Excel and start Sketchup automatically where a new model is created that inserts dynamic components with the correct dimensions as specified in MS Excel.

      I've automated Excel from Sketchup (with Win32OLE), but not managed find a way to automate Sketchup from Excel. Is this possible?

      Phil

      p.s. Ideally I'd like to avoid the user having to start Sketchup (and run a ruby where they have to pick the Excel file which is then interrogated from a Sketchup ruby)

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

        I've done what you've done, created excel sheets from Ruby based on contents of the model.

        I suspect you could do what you want to do through VBA. If VBA can kick off a process, then it could kick off SU, and a plugin could be implemented that communicates with your VBA code. Not sure how that would work, perhaps through a pipe.

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

          OK. This is what I've come up with:

          1. Export a file to the users profile (c:\documents and settings) with a standard name.
          2. Start Sketchup via VBA
          3. Sketchup has an ruby that checks for the existence of the file created in step 1.
          4. Create dynamic components according to the contents of the file
          5. Delete the file so that it's not re-processed next time sketchup is opened.

          It's a bit annoying in that the users has to run a further ruby script inside Sketchup because the $dc_observers variable is not setup with the dynamic components are being inserted in step 4.

          1 Reply Last reply Reply Quote 0
          • chrisglasierC Offline
            chrisglasier
            last edited by

            I have a wip that can pick up plain text lists (including Excel .csv files) and open them in a Sketchup model. It can also inspect an existing model and assemble entity names in automated hierarchies, each linking to its data. If interested have a look at the flyer linked below and let me know me what think.

            With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

            1 Reply Last reply Reply Quote 0
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              @filcole said:

              It's a bit annoying in that the users has to run a further ruby script inside Sketchup because the $dc_observers variable is not setup with the dynamic components are being inserted in step 4.

              Your file in step 3/4 should have at the top:
              require( 'dynamiccomponents' )
              to be sure the DC extension is loaded before your script tries to use or create dynamic components.

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                Here's another forum link along these lines:

                Excel to SU ( 29/7/08 version ) [has code for download]

                I'm not here much anymore.

                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