Results 1 to 5 of 5

Thread: Variable columns in Excel

  1.    #1
    Moderator DaveP's Avatar
    Join Date
    January 10, 2011
    Location
    St Paul, MN
    Posts
    3,535
    Current Local Time
    12:05 AM

    Not allowed! Not allowed!

    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.
    Click image for larger version. 

Name:	Equipment Graph.PNG 
Views:	9 
Size:	88.5 KB 
ID:	40300
    Maybe somehow create a dictionary?

  2.    #2
    Forum Addict elton williams's Avatar
    Join Date
    December 7, 2010
    Location
    Gold Coast
    Posts
    2,889
    Current Local Time
    03:05 PM

    Not allowed! Not allowed!
    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

  3.    #3
    Member
    Join Date
    December 11, 2010
    Location
    Astana
    Posts
    317
    Current Local Time
    11:05 AM

    Not allowed! Not allowed!
    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.

  4.    #4
    Member Bjorn_K's Avatar
    Join Date
    April 8, 2011
    Location
    Rotterdam, Netherlands
    Posts
    456
    Current Local Time
    07:05 AM

    Not allowed! Not allowed!
    Assuming at least the names are something you know this should work:

    Click image for larger version. 

Name:	multiple_header_search.png 
Views:	8 
Size:	1.14 MB 
ID:	40307

    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.

  5.    #5
    Moderator DaveP's Avatar
    Join Date
    January 10, 2011
    Location
    St Paul, MN
    Posts
    3,535
    Current Local Time
    12:05 AM

    1 Not allowed! Not allowed!
    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
    Click image for larger version. 

Name:	Column Dictionary.PNG 
Views:	11 
Size:	70.6 KB 
ID:	40330

Similar Threads

  1. Variable Floor Help
    By Kyle Roseman in forum Architecture and General Revit Questions
    Replies: 13
    Last Post: September 6th, 2019, 04:13 PM
  2. Replies: 1
    Last Post: August 25th, 2017, 10:25 PM
  3. Renaming From Excel - After Sorting Data in Excel
    By cellophane in forum Dynamo BIM
    Replies: 8
    Last Post: January 18th, 2016, 01:24 PM
  4. Replies: 3
    Last Post: June 6th, 2015, 11:18 AM
  5. Variable 'If' Statement
    By Nevin in forum Architecture - Family Creation
    Replies: 1
    Last Post: June 5th, 2014, 06:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •