• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Automating Sketchup from Excel

Scheduled Pinned Locked Moved Developers' Forum
6 Posts 4 Posters 6.5k Views
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 6 Mar 2010, 14:57

    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 6 Mar 2010, 15:19

      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 8 Mar 2010, 01:45

        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
        • C Offline
          chrisglasier
          last edited by 8 Mar 2010, 02:54

          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
          • D Offline
            Dan Rathbun
            last edited by 25 Jul 2010, 02:01

            @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
            • D Offline
              Dan Rathbun
              last edited by 25 Jul 2010, 02:29

              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