See the top rated post in this thread. Click here

Page 1 of 10 12345 ... LastLast
Results 1 to 10 of 96

Thread: copy from excel into Revit

  1. #1
    100 Club
    Join Date
    2005-02
    Location
    St Louis, MO and Tirunelveli, India
    Posts
    130
    Login to Give a bone
    2

    Default copy from excel into Revit

    Here is a small script I wrote using Autohotkey to copy data from Microsoft Excel or Open Office.org into a Revit Schedule. It works for all versions and flavors of Revit.
    The user interface has been changed quite a bit. No prep work is needed. The exe can be located anywhere in your drive.
    I added a version for Revit 2010.
    I updated the 2010 version to work with SP1. I also added an option to make wait for 'x' seconds, if the Revit project runs slower than the script.

    What does the EXE do:
    ###############################################################
    * The script checks if a Revit schedule view is open. Does not
    continue until this is satisfied.
    * The script checks if a spreadsheet is open. Does not
    continue until this is satisfied.
    * It shows a help message.
    * (If you dont want this msg to appear in the future, the
    script saves the setting in your windows registry)
    * Asks for the number of rows and columns that need to be copied.
    * Asks you to select a cell in the spreadsheet from where to start copying data.
    * Asks you to select a cell in Revit from where to start pasting.
    * Runs happily there after!
    * You can press escape to cancel the script.
    ################################################################
    Instead of updating the exe in two places, I have decided to update only in my website and link the zip files from here.
    Click here to download the zip for Revit 2009 copy from Excel
    Click here to download the zip for Revit 2010 copy from Excel
    Last edited by ijnicholas; 2009-11-09 at 11:11 PM. Reason: updated for 2010 - SP1 (subscription pack)

  2. #2
    100 Club priitl22047477's Avatar
    Join Date
    2003-02
    Location
    Tallinn,Estonia
    Posts
    193
    Login to Give a bone
    0

    Default Re: copy from excel into Revit

    Could you make it for Revit Structure also? i would love to try this out.
    Priit
    Structural Engineer

  3. #3
    I could stop if I wanted to
    Join Date
    2007-12
    Location
    Las Vegas, NV
    Posts
    236
    Login to Give a bone
    0

    Default Re: copy from excel into Revit

    Quote Originally Posted by Priit.L View Post
    Could you make it for Revit Structure also? i would love to try this out.
    you just need to switch the "Version" info in the beginning of the program to "Revit Structural" and it should work. I had to do the same for MEP and it works great.

    Very nice tool! Thanks for sharing.

  4. #4
    Member
    Join Date
    2008-11
    Location
    Las Vegas
    Posts
    7
    Login to Give a bone
    0

    Default Re: copy from excel into Revit

    Here is the MEP code and program. I also fixed a bug that happened if the number of columns entered didn't match the number of columns in Revit. Enjoy, and thanks for sharing. David Rushforth


    Code:
    ;########################## Start ###############################################
    
    #SingleInstance force		
    version = Revit MEP
    Excelversion = Microsoft Excel
    
    Msgbox, This program copies cell values from Excel to Revit.`n`nOpen the key schedule view in Revit, and select the top left most cell.`nYou should have created the necessary rows already in Revit.`n`nOpen the excel file and select the top left most cell to start copying from.`nYou should know the number of rows and columns that are to be copied.`n`n Press OK only after doing these, else this program will fail.`n`n (Modified by David Rushforth from an original program by Nicholas Iyadurai)
    
    
    SetTitleMatchMode 1
    IfWinnotExist %version%
    {
    MsgBox,,, %version% is not open.  `n The program will now exit., 2
    ExitApp
    }
    
    IfWinnotExist %Excelversion%
    {
    MsgBox,,, %Excelversion% is not open.  `n The program will now exit., 2
    ExitApp
    }
    
    GetFileInfo:
    Gui, Add, Text,, No of Rows to be copied:
    Gui, Add, Text,, No of Columns to be copied:
    Gui, Add, Edit, vNiRowNo ym  ; The ym option starts a new column of controls.
    Gui, Add, Edit, vNiColNo
    Gui, Add, Button, default, OK  ; The label ButtonOK (if it exists) will be run when the button is pressed.
    Gui, Show,, Copy Excel to Revit
    return  ; End of auto-execute section. The script is idle until the user does something.
    
    GuiClose:
    ButtonOK:
    Gui, Submit  ; Save the input from the user to each control's associated variable.
    if NiRowNo =
    {
    MsgBox,,, You entered 0 rows.  `n The program will now exit, 2
    ExitApp
    }
    
    if NiColNo =
    {
    MsgBox,,, You entered 0 columns.  `n The program will now exit, 2
    ExitApp
    }
    
    
    NiColNominus := NiColNo - 1
    NiRowNominus := NiRowNo - 1
    
    copyexcel:
    
    
    loop, %NiRowNo%
    {
    currentcolumn := 1
    loop, %NiColNo%
    {
    if currentcolumn <> 1
    {
    WinActivate %version%
    Send {Tab}
    }
    currentcolumn := currentcolumn + 1
    WinActivate %Excelversion%
    Send {Control down}c{Control up}{Tab}
    WinActivate %version%
    Send {space}{Backspace}{Control down}v{Control up}
    }
    Send {Enter}{Left %NiColNominus%}
    WinActivate %Excelversion%
    Send {Down}{Left %NiColNo%}
    }
    
    ;########################## End ###############################################
    
    MsgBox, 0, Done., The cells have been copied.  `n Please check the data.
    
    ExitApp
    
    ;##############################################################################
    Attached Files Attached Files
    Last edited by RobertB; 2009-03-12 at 11:45 PM. Reason: added code tags

  5. #5
    100 Club priitl22047477's Avatar
    Join Date
    2003-02
    Location
    Tallinn,Estonia
    Posts
    193
    Login to Give a bone
    0

    Default Re: copy from excel into Revit

    At first I just did not look at the other file that was with exe file.
    Yes everything works just fine.

    But:How could i change it to start from active cell on Revit schedule? Not the next one on the left from active cell.
    Priit
    Structural Engineer

  6. #6
    AUGI Addict truevis's Avatar
    Join Date
    2004-07
    Location
    Massachusetts, USA
    Posts
    1,191
    Login to Give a bone
    0

    Default Re: copy from excel into Revit

    Quote Originally Posted by sgermano View Post
    you just need to switch the "Version" info in the beginning of the program to "Revit Structural" and it should work. I had to do the same for MEP and it works great. ..
    Just use "Revit" in your "...Win..." lines, and it'll work for any flavor of Revit. E.g:

    IfWinNotExist, Revit
    IfWinExist, Revit
    WinActivate, Revit
    Last edited by truevis; 2009-03-13 at 02:29 PM.

  7. #7
    100 Club
    Join Date
    2005-02
    Location
    St Louis, MO and Tirunelveli, India
    Posts
    130
    Login to Give a bone
    0

    Default Re: copy from excel into Revit

    Quote Originally Posted by david.199936 View Post
    Here is the MEP code and program. I also fixed a bug that happened if the number of columns entered didn't match the number of columns in Revit. Enjoy, and thanks for sharing. David Rushforth
    Thanks David. I could not understand the bug you mention. However, I wrote a similar script that copies data from one revit schedule to another. I posted it here . Please take a look at this too.
    When I get sometime, I will update the 'copy from excel' script.

  8. #8
    All AUGI, all the time
    Join Date
    2007-06
    Location
    Melbourne, Australia
    Posts
    602
    Login to Give a bone
    0

    Default Re: copy from excel into Revit

    Hi ijnicholas,

    Thanks very much for this neat tool. It works beautifully and I will find it very useful for a number of different matters. I appreciate your effort.

    Thanks again

    Ian

  9. #9
    100 Club
    Join Date
    2005-02
    Location
    St Louis, MO and Tirunelveli, India
    Posts
    130
    Login to Give a bone
    0

    Default Re: copy from excel into Revit

    I updated the exe file swapped the executable file with the updated version.
    Now the script copies from excel or Open Office (I love Open office!)
    No prep work is needed. (the script checks for opened revit schedule and spreadsheet, etc.)
    Works for any version of Revit or flavor (arch / mep / structure, etc.)
    Removed the bug reported by David (Thank you!)
    The script asks you to select the cell in the spreadsheet to start copying and a cell in Revit to start pasting...
    Please try this and comment.
    Thanks

  10. #10
    AUGI Addict truevis's Avatar
    Join Date
    2004-07
    Location
    Massachusetts, USA
    Posts
    1,191
    Login to Give a bone
    0

    Default Re: copy from excel into Revit

    With AHK, it's actually possible to directly read Excel without the clipboard trick.
    See:
    http://www.autohotkey.com/forum/topic31923.html

Page 1 of 10 12345 ... LastLast

Similar Threads

  1. 2015: IS IT POSSIBLE TO COPY TEXT FROM AUTOCAD INTO AN EXCEL SHEET ???
    By doyle.84974 in forum AutoCAD General
    Replies: 3
    Last Post: 2015-02-05, 12:50 PM
  2. I just copy commands from excel, any pointers?
    By matib88438333 in forum AutoLISP
    Replies: 3
    Last Post: 2013-11-05, 04:01 PM
  3. Copy attributes from blocks to excel
    By Negi in forum AutoLISP
    Replies: 3
    Last Post: 2013-07-26, 01:47 PM
  4. Run copy of Excel inside ACAD?
    By brian.keever in forum VBA/COM Interop
    Replies: 4
    Last Post: 2006-06-28, 02:15 PM
  5. VBA to Excel Copy Question
    By PellaCAD in forum VBA/COM Interop
    Replies: 1
    Last Post: 2005-05-05, 06:39 PM

Posting Permissions

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