Announcement

Collapse
No announcement yet.

Variable columns in Excel

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Variable columns in Excel

    I'm working on a graph that will read an Excel file and create Family Types.
    I've got everything working (I'll share if you want it) but the problem I'm having is every time we get a spreadsheet from a new client, everything is in different columns.
    So what I'd like to be able to do is either read the column headers and have Dynamo figure out what that column is, or maybe have a second Tab in the spreadsheet that would call out
    Column F Width
    Column G Depth
    Column H Height
    Column Q Type Name
    And then somehow have Dynamo translate that into which column to use to pass that parameter
    But I can't think of a good way to do that without a thousand wires flying all over.
    Equipment Graph.PNG
    Maybe somehow create a dictionary?
    Dave Plumb
    BWBR Architects; St Paul, MN

    CADsplaining: When a BIM rookie tells you how you should have done something.

    #2
    Couldnt you just provide the client with a template excel file?
    What you want would negate some of the human error though, and im sure its possible but its a bit beyond my dynamo skills atm :laugh:
    There are no stupid questions, only stupid people

    Comment


      #3
      Suppose that the names of the columns are different each time, then manually opening the spreadsheet and determining the required columns cannot be avoided. I would add 4 input number nodes to the script to override the column indices retrieved from the Excel file, if required.

      Comment


        #4
        Assuming at least the names are something you know this should work:

        multiple_header_search.png

        Might want to make a little interface where people can enter the Column names if they differ. I would not play with the order there, knowing which property is in which position after you rejigged it will let you do all the other things you want.

        If the names of the columns are something you can rely on, you can just use this to fire&forget in all cases.

        I used this last year without any trouble at all while dealing with a customer whose data-archive was such a mess I'm reluctant to call it an archive.

        Comment


          #5
          I'd love to give the client a template to start from, but most of what we get are from their facilities group and they've been using the spreadsheet the way they want it for years. Far be it for us to make them change.

          Here's what I ended up doing.
          As I feared, there are a lot of wires, but at least this will make it easy to tweak the graph for each variety
          Column Dictionary.PNG
          Dave Plumb
          BWBR Architects; St Paul, MN

          CADsplaining: When a BIM rookie tells you how you should have done something.

          Comment


            #6
            Originally posted by DaveP View Post
            ... read the column headers and have Dynamo figure out what that column is...
            You can use List.IndexOf on the column headers to search for which is where.

            Comment

            Related Topics

            Collapse

            Working...
            X