PDA

View Full Version : copy from excel into Revit



ijnicholas
2009-03-05, 09:54 PM
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 (http://www.nichitecture.com/downloads/excel%20copy.zip)
Click here to download the zip for Revit 2010 copy from Excel (http://www.nichitecture.com/downloads/Copy%20Spreadsheet%20for%20Revit%202010.zip)

priitl22047477
2009-03-12, 01:33 PM
Could you make it for Revit Structure also? i would love to try this out.

sgermano
2009-03-12, 07:18 PM
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.

david.199936
2009-03-12, 10:26 PM
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



;########################## 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

;##############################################################################

priitl22047477
2009-03-13, 06:40 AM
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.

truevis
2009-03-13, 12:00 PM
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

ijnicholas
2009-03-13, 07:50 PM
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 (http://forums.augi.com/showthread.php?p=953102). Please take a look at this too.
When I get sometime, I will update the 'copy from excel' script.

iankids
2009-03-14, 12:30 AM
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

ijnicholas
2009-03-15, 03:56 AM
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 (http://www.openoffice.org/)!)
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

truevis
2009-03-16, 11:36 AM
With AHK, it's actually possible to directly read Excel without the clipboard trick.
See:
http://www.autohotkey.com/forum/topic31923.html

cstanley
2009-04-03, 08:46 PM
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 (http://forums.augi.com/showthread.php?p=953102). Please take a look at this too.
When I get sometime, I will update the 'copy from excel' script.


thanks for the tool. this one just saved me a LOT of tedious copy/paste work!

ijnicholas
2009-04-08, 08:47 PM
With AHK, it's actually possible to directly read Excel without the clipboard trick.

I tried. Directly reading excel seemed to be too cumbersome. Could not understand. I dont have any formal training in programming. Do you mind sharing the code that will substitute this clipboard trick...
Thanks.

derrenangie
2009-04-16, 02:29 PM
I had a hard time getting this to work right, but I figured out why.

Revit was sorting my first column in ascending order and updating between pastes. So each time the first column had new data, it was reordered alphabetically and then the adjacent cell received the wrong data. So I set my sorting and grouping to 'None' and it went fine.

Thanks for the script!

arqt49
2009-04-17, 02:02 AM
I Nicholas,
I have been using your copy to spreadsheet script and it has proven very useful.
Loved it a lot... until I just updated today to 2010!
Is there a easy workaround this?

ijnicholas
2009-04-18, 09:13 PM
I added an zipped exe file for Revit 2010 version in the original (first) post. Please report any bugs. Thanks.

arqt49
2009-04-19, 02:09 AM
I added an zipped exe file for Revit 2010 version in the original (first) post. Please report any bugs. Thanks.

Don't Thank me.
I and all other people using your script thank you!
Your 2010 version is working great with a couple of tests.

iankids
2009-04-19, 05:32 AM
Don't Thank me.
I and all other people using your script thank you!
Your 2010 version is working great with a couple of tests.

Along with arqt49....I offer my thanks for this very useful api.

Cheers,

Ian

phildouthard
2009-04-24, 01:14 AM
newbie question here, excuse me for the lack of knowledge! - but would you be able to use the same code to copy from MS access into revit?

truevis
2009-04-24, 01:45 PM
newbie question here, excuse me for the lack of knowledge! - but would you be able to use the same code to copy from MS access into revit?

That kind of AHK script simply copies text to the clipboard and types it into Revit. What it gets on the clipboard can come from any application that one can do it from manually with the keyboard. The script would just need to be modified appropriately. I use something similar to get data from SharePoint into Revit.

ijnicholas
2009-04-30, 02:25 AM
newbie question here, excuse me for the lack of knowledge! - but would you be able to use the same code to copy from MS access into revit?
Yes. The source code can be edited to copy from Access. The exe file available in this thread does not do it.

wrartes
2009-05-06, 06:00 PM
HOW I CAN RENAME THE FILE TO BE USED IN REVIT STRUCTURE?

Gene Herring
2009-05-09, 01:47 AM
Anyone have an idea why I can use the tool to copy text from my spreadsheet but not numeric values. When the program executes, it walks through the the text columns but stops at the first number? Also now that I realize, it does the same thing if I try to manually copyclip numbers. get an error message that says "enter a value or a formula starting with an =". I am trying to populate a key schedule with values from excel. Thanks for any suggestions anyone may have.

ijnicholas
2009-05-12, 10:23 PM
HOW I CAN RENAME THE FILE TO BE USED IN REVIT STRUCTURE?
I think it already works in any flavour of revit. Please try and let me know.

ijnicholas
2009-05-12, 10:24 PM
Anyone have an idea why I can use the tool to copy text from my spreadsheet but not numeric values.
This was a bug. Now fixed. Thanks for reporting.

Gene Herring
2009-05-13, 03:03 AM
Nicholas, I am stumped here. I don't think anything is wrong with your script. I get the same results with a manual copy and paste of a single cell value from excel to clipboard to paste in Revit. It only happens with numeric values! the script works perfect with text values pasted into text formatted parameters. Are you aware of any limitations to pasting numeric vales in key schedules? I am setting them up as numeric format instance driven parameters.

Danny, any ideas from your end?

ijnicholas
2009-05-13, 11:48 AM
Copying and pasting from excel leaves a 'space' at the end. This space didnt create a problem with texts but with numbers, revit does not like it. The change i made removed this space at the end after copying and worked fine in excel. I have not checked with open office.

mwiggins121466
2009-05-13, 06:58 PM
I am setting them up as numeric format instance driven parameters.

Gene, this is the problem that I ran into. As soon as I changed the parameters to text format, all was fine.

truevis
2009-05-14, 11:46 AM
AutoHotKey has a very powerful command: RegExReplace

http://www.autohotkey.com/docs/commands/RegExReplace.htm

I think removing a space at the end would be like:
NewStr := RegExReplace("123123 ", " $")

corymadams
2009-05-14, 10:24 PM
Can someone tell me how to set up the schedule in Revit so that it will take the copied info form excel? I can only get the coments field to accept imput from excel.

corymadams
2009-05-15, 03:58 PM
How do I set up non type driven cells in Revit?

Gene Herring
2009-05-16, 02:06 AM
Cory, see the attached image. When you set up your parameter you select the "instance" parameter option.

All, I am building a series of "key schedules" that I currently use excel spreadsheets for, but the data is "much" more efficiently manipulated directly inside of Revit. I have had great success using Nicholas app with text values (great job Nicholas and many thanks), but have not been able to get the numric values to copy over. I have also tried as mentioned in the post above (mwiggens) converting them to text, but I am using the values in calculated fields in various schedules.

So question for the experts, can a text based parameter with a numeric value be conditionally formatted to work in a formula? Otherwise I need to get Nicholas app working with numbers. (too much data to re-enter if can be avoided)

Also, Nicholas you seem to have it working on your end. Are your parameters numeric?

ijnicholas
2009-05-18, 12:22 PM
Gene,
Please let me know if you downloaded the latest update of the copy spreadsheet.exe from the link that is shown in the first post in this thread? The exe is dated 5/6/09. I made some modifications to the code, which allowed it to copy numbers from excel into revit.
Text formatted data may not be used in calculations.

Gene Herring
2009-05-18, 03:17 PM
Nicholas, thanks very much for your help with this. Your program has truly bee a life saver.

Just to be sure, I downloaded the file again and ran for sure your newer version. However, I still get the same errors for the numeric fields. Again the text columns copy fine, however when it gets to the numeric columns the error comes up. Thanks.

I have attached a sample .rvt and .xls file if you want to test it out. Thanks.

truevis
2009-05-18, 04:02 PM
For any AutoHotKey script to run with Revit, you have to be able to do the same thing manually first. If you can not do it manually, fix that problem or else AHK will never be able to do it for you.

You may also have unwanted special characters in your XLS. To clean, select the range of cells of interest and run this macro:
Sub CleanCells()
'Strips special characters (line feeds, etc.) from all selected cells
Dim Cell As Range
For Each Cell In Selection
Cell.Value = WorksheetFunction.Clean(Cell.Value)
Next Cell
End Sub
To use this macro in your current workbook, go to the Visual Basic Editor (keyboard Alt-TMV), insert a new macro module (keyboard Alt-IM), and paste the above code into the Code pane. To run it go back to Excel, select the range of interest, and (keyboard Alt-TMM Enter).

ijnicholas
2009-05-19, 02:39 PM
I have attached a sample .rvt and .xls file if you want to test it out. Thanks.
Gene,
In excel you have used the 1000 separator (,) for the numbers format. Revit for some reason does not like this comma. I changed the numbers format in your excel file to be without the 1000 separator and the script works fine.
Please try this and let us know.

Gene Herring
2009-05-19, 08:20 PM
Nicholas, YES,YES,YES, exactly the problem. works perfect now!

Nicholas, Truevis many thanks for your help and feedback with this. What a life saver!

corymadams
2009-07-22, 05:22 PM
Cory, see the attached image. When you set up your parameter you select the "instance" parameter option.

All, I am building a series of "key schedules" that I currently use excel spreadsheets for, but the data is "much" more efficiently manipulated directly inside of Revit. I have had great success using Nicholas app with text values (great job Nicholas and many thanks), but have not been able to get the numric values to copy over. I have also tried as mentioned in the post above (mwiggens) converting them to text, but I am using the values in calculated fields in various schedules.

So question for the experts, can a text based parameter with a numeric value be conditionally formatted to work in a formula? Otherwise I need to get Nicholas app working with numbers. (too much data to re-enter if can be avoided)

Also, Nicholas you seem to have it working on your end. Are your parameters numeric?

Gene,

Thanks for your reply. I must be a little retarded because i still can not get it to work right. Do I start with a schedule and then just add my own parameter making sure that they are instance parameters? I must just be setting it up wrong. I just get a failed warning saying it is most likely due to type parameters.

ijnicholas
2009-07-23, 02:01 PM
The revit schedule should have pasteable cells available. The parameters need to be instance parameters. Before using the script, it is a good idea to copy one cell manually from excel and try pasting it in Revit. If this gives an error, then your revit schedule is NOT setup correctly for the script to work.

alan.jackson
2009-08-17, 07:49 PM
Can anyone walk me through the process of creating a blank schedule in Revit. I am in MEP Revit and can not get the "New" button for rows to work, it is always greyed out.

thanks

-
aj

Scott Womack
2009-09-15, 10:28 AM
Can anyone walk me through the process of creating a blank schedule in Revit. I am in MEP Revit and can not get the "New" button for rows to work, it is always greyed out.

To create a "blank" schedule (Proper Revit term is a Key Schedule), You create a new schedule, select a specific catagory (Try selecting the small checkbox in the lower left corner to display all disciplines) and after selecting it, There is a larger set of items to choose from. Once you select a catagory, there is a button in the middle of the resultant dialog box, allowing you to select Schedule Keys as a radio button. Select it, then OK. Then add a field or fields. I usually "Add" new parameters, rather than selecting from the dialog box. You do need to watch what "type" of parameter you are creating, Excel text won't paste into a number field, etc. Text fileds cannot be "operated" on. Now, the New Lines button will be active.

alan.jackson
2009-09-15, 01:12 PM
To create a "blank" schedule (Proper Revit term is a Key Schedule), You create a new schedule, select a specific catagory (Try selecting the small checkbox in the lower left corner to display all disciplines) and after selecting it, There is a larger set of items to choose from. Once you select a catagory, there is a button in the middle of the resultant dialog box, allowing you to select Schedule Keys as a radio button. Select it, then OK. Then add a field or fields. I usually "Add" new parameters, rather than selecting from the dialog box. You do need to watch what "type" of parameter you are creating, Excel text won't paste into a number field, etc. Text fileds cannot be "operated" on. Now, the New Lines button will be active.

Perfect! Thank you for your help.

-
aj

Bimmer
2009-09-17, 03:29 PM
Is there a way to copy Excel to Revit Share parameters. The problem I run into is that the utilities copies from excel and paste into Revit, but Revit responses slower than Excel. The utility does not wait for the Revit paste operation. The result is cells pasting in the wrong cell in Revit.

Is there a timeout script that tells the utility to complete each option before proceeding to the next?

lbegnaud.42448
2009-10-09, 03:09 PM
I created a new key schedule, but when I ran the script, it just kept overwriting the first line, instead of adding to the schedule. Any solutions to this issue would be appreciated.

ijnicholas
2009-10-10, 12:06 PM
The script does NOT add rows. Before running the script, please add empty rows by clicking the "add rows" button available in the option bar. The script can paste data only cells ONLY if they are available.
I hope this works
Nicholas.

pfaudler
2009-10-23, 11:04 AM
hi,
I tried this script on RAC 2010 64bit PC but doesnt copy data. May be I am missing something here.

I open a new revit project and create a room key schedule. I then add default instance paramaters like base finish, ceiling finish etc. then i open a new excel spread sheet and add 2 row and 6 columns with abstract values. with both program open i start this script and it asks for no of rows and columns, then start cell in xcel and start cell in revit. then it runs with no error. But when it inishes, i dont see those pasted values in revit key schedules.

thansk in anticipaiton of your help.

CADMama
2009-11-02, 02:47 AM
Nope you did not make a mistake. I used this last week at the office and it worked great.
Tried it tonight on my new 64 bit laptop and it is a no go. Shame too - I wanted to hightlight Nicholas and his blog as well as this program at AU next month. I was going to put this thread in my handout and show how well this program worked.

Hopefully it can be fixed for the 64 bit was well.

Pierre-Nelson NAVARRA
2009-11-05, 04:16 PM
Thx ijnicholas (http://forums.augi.com/member.php?u=82168) for this script.

If someone are interested about importing from excel, I done fiew months ago an API function that imports and creates non placed rooms in a schedle with theoric areas...
Here is the post where you can find all of my functions :
http://forums.augi.com/showthread.php?t=84766
here (http://www.box.net/shared/0ltckunfxk)is the video of the function.

Thx for all.

CADMama
2009-11-05, 06:23 PM
Thx ijnicholas (http://forums.augi.com/member.php?u=82168) for this script.

If someone are interested about importing from excel, I done fiew months ago an API function that imports and creates non placed rooms in a schedle with theoric areas...
Here is the post where you can find all of my functions :
http://forums.augi.com/showthread.php?t=84766
here (http://www.box.net/shared/0ltckunfxk)is the video of the function.

Thx for all.

Does yours run on 64 bit w/2010? nicholas's does not at this time. I am holding out hope for this to be updated soon.

Pierre-Nelson NAVARRA
2009-11-06, 08:19 AM
It runs on 64bits.
I did not tested yet on RAC2010 but seems to run.
Check here (http://forums.augi.com/showthread.php?t=84766&page=8)

ijnicholas
2009-11-06, 12:37 PM
Does yours run on 64 bit w/2010? nicholas's does not at this time. I am holding out hope for this to be updated soon.
Sorry about this. Have not had time to update the script.

CADMama
2009-11-06, 01:38 PM
Sorry about this. Have not had time to update the script.

I see the stress on your face in your avatar. LOL
I will be featuring your work at AU in my class which is basically tips and tricks. I am also pointing them to your blog as well. If you get it updated I can actually show them how it works, if not, they will just have to "trust me" on this one. he he

CADMama
2009-11-06, 01:41 PM
It runs on 64bits.
I did not tested yet on RAC2010 but seems to run.
Check here (http://forums.augi.com/showthread.php?t=84766&page=8)

I kinda got lost over there - could not read anything. What link should I try??? Could you just post it here also? Sorry but I am so not bilingual.

Pierre-Nelson NAVARRA
2009-11-06, 02:27 PM
Hi,

Go here (http://www.box.net/shared/0ltckunfxk)to see the video of what the function does.
Go here (http://www.box.net/shared/v0v7n6gsz6)to download my api that you have to add using Add-in Manager.
Go here (http://www.box.net/shared/zx0cmcdead)to download shared parameters
Here (http://www.box.net/shared/12nnyetak9)is the excel file.

Function called CreationAutoPiecesViaFile

Hope it'll help.

fernandez
2009-11-06, 04:41 PM
This script used to work great for me (thanks for sharing it with us) but for some reason, the cells in my schedule have changed. . . before I was able to tab through fields and edit them as I went along, but now, they are only editable when I click on them, so the script is tabbing through the fields and pasting but no data is being entered because of this new and strange click-first problem.

Is anyone else experiencing this? Any way to get around it?

ijnicholas
2009-11-07, 12:36 PM
I will be featuring your work at AU in my class which is basically tips and tricks. I am also pointing them to your blog as well. If you get it updated I can actually show them how it works, if not, they will just have to "trust me" on this one. he he
Wonderful! I wish I would be there. Not happening, unless adesk sponsors me! :(
Most probably I will update it by then and let you know...



This script used to work great for me (thanks for sharing it with us) but for some reason, the cells in my schedule have changed. . .
Yes. The new subscription update from Autodesk has changed this behaviour. (See http://revitoped.blogspot.com/2009/10/dept-of-bugs-entering-data-in-schedules.html)

I know the moment I change my script, Autodesk will change the behaviour again! :(

truevis
2009-11-09, 02:09 AM
...I know the moment I change my script, Autodesk will change the behaviour again! :(
I've basically used something like this to type into schedules for a while. SP1 does not wreck it:

Send, {F2}{SHIFTDOWN}{END}{SHIFTUP}
SendInput, %ScheduleText%

ijnicholas
2009-11-09, 11:32 PM
Send, {F2}{SHIFTDOWN}{END}{SHIFTUP}
SendInput, %ScheduleText%
Thanks. I updated the script. I checked it only in RVT 2010 - SP1 in 64 bit Vista. Please let me know if this works.
For large, slow revit projects, the script was tooooo fast and was copying data in the wrong cells! I added an option where you could make the script wait for Revit to complete accepting the pasted data.
The links available in the first post now downloads the latest version.
nicholas.

ijnicholas
2009-11-09, 11:44 PM
The problem I run into is that the utilities copies from excel and paste into Revit, but Revit responses slower than Excel. The utility does not wait for the Revit paste operation. The result is cells pasting in the wrong cell in Revit.

Is there a timeout script that tells the utility to complete each option before proceeding to the next?
Bimmer,
I added an option where you can specify the number of seconds the script should wait after the paste operation in Revit.

fernandez
2009-11-10, 12:01 AM
Thanks so much for the updated script! Works great!

truevis
2009-11-10, 12:40 PM
Timing is an issue, especially when doing a Room schedule. Not only do I do

WinWaitActive, Autodesk Revit
Sleep 300

after each type-in, I do a

GoSub, WaitForNotHourglass
.....................................

WaitForNotHourglass:
Loop, 1000
{
If not (A_Cursor = "AppStarting")
break
sleep, 100
}
Return

CADMama
2009-11-17, 03:21 AM
Thanks. I updated the script. I checked it only in RVT 2010 - SP1 in 64 bit Vista. Please let me know if this works.
For large, slow revit projects, the script was tooooo fast and was copying data in the wrong cells! I added an option where you could make the script wait for Revit to complete accepting the pasted data.
The links available in the first post now downloads the latest version.
nicholas.


I am so loving it.
Amazing. I am going to promote you to Revit Rock Star! Everyone at AU will be talking about you!

eed
2010-02-03, 01:20 AM
THANK YOU!! This is amazing.

msullivan
2010-02-22, 02:10 PM
Can this be setup to work with a Drawing List as well? When I try to use it it tells me I am not in a schedule view.

Thanks!

rkitect
2010-04-16, 03:06 PM
Thanks for this! Just wanted to mention (not sure if it already was) that in order for the order to be kept in the Revit scehdule, Sorting by name must be turned off.

Cheers!

kafka
2010-05-04, 06:14 PM
hei nicholas,

the script keeps asking me to open a Revit schedule!! I can't go through that..
I created a blank Revit Key Schedule with custom parameters and add few lines. I opened this schedule and run the exe. then it keeps asking to open a schedile.
Im on Revit2010 sp2 32bit ITALIAN version. maybe is the Revit language?

josh.made4worship
2010-05-17, 08:53 PM
Hi, has this been updated for Revit 2011 yet? I get the same error mentioned above almost like the .exe I have is looking for Revit 2010 instead of Revit 2011...

orges2005
2010-05-26, 10:22 PM
Hi, I tried the script, but it didn't work. This happened because I have Revit in Italian language or because i didn't get how it works?? Thanks.

Alfredo Medina
2010-05-30, 03:45 PM
OK, I have read absolutely all the messages in this thread, and I could not find any answers to my questions. I am sure this is because I am in the API forum, and I don't know about API yet. Excuse for me for my ignorance about customization in Revit, but here I go:

There is a .exe file posted in this thread about the Copy from Excel to Revit tool, written by Nicholas and modified by David, but when I download it and execute it, it tells me that I am not using Revit MEP. OK, so I read here that I can modify the code posted by Nicholas and just change "Revit MEP" to be "Revit Architecture", that's easy, but sorry, what do I do next? What tool do I use now? Where do I paste this code to compile it again as a .exe file and run it again? , and will it run it Revit Architecture 2011?

I would appreciate any help.

truevis
2010-05-31, 07:16 AM
Here is a video of me using scripts I wrote to do similar tricks:
http://www.youtube.com/watch?v=q9kxuhdQOvk

Alfredo Medina
2010-05-31, 05:22 PM
Thank you for the link to the video. OK. So I have the first clue to the mystery... I am going to download AutoHotKey... first step...

Alfredo Medina
2010-06-01, 01:40 AM
Well, good news! After struggling with this for several hours, I got it to work. For some reason the code I downloaded from here was putting the information in random places, no matter what I tried. I was doing my tests using Revit Architecture 2011.

So I modified the code using While conditions instead of Loops; I added the timing to wait for the windows to be active, as somebody recommended, and now the script is working properly.

Attached is my version, tested in Revit Architecture 2011, if anybody find it useful.

INSTRUCTIONS:
------------------------------------------------------------------------------------------------------------------------
The usage is mainly for populating data in Key schedules in Revit from data in Excel. (You can also use it in regular schedules).
In Revit you go to View > Schedules > (select a category like Doors) > Key schedules. Pass all the fields you need, or create more fields by using Add parameter > use only TEXT instance parameters. (If there is a field that is not set to expect text data, the routine will fail and might cause a crash). Then, in the key schedule, you need to use the New button to create as many rows as you want to import. The key schedule should NOT be sorted. Use Sorting/Grouping > none.

Open Excel as well, and arrange the two programs side by side. In Revit, click on the cell that corresponds to the first row below the first column header. Then, in Excel, do the same, click on the cell that corresponds to the first column and first row of the area of data that you want to import. Then, run this .exe file. Provide the number of rows, and the number of columns to import, and click OK. You need to wait for the script to finish. Any click anywhere while this is working will cause wrong results.

------------------------------------------------------------------------------------------------------------------------

Thanks to Nicholas Iyadurai for having shared the script, to David Rushforth for having posted his modified version, and to Truevis for providing me with an introduction to AutoHotKey. If somebody explains me how to post code in the forum, I will post it, in case somebody wants to continue working on it.

truevis
2010-06-01, 12:17 PM
... If somebody explains me how to post code in the forum, I will post it, in case somebody wants to continue working on it.

Simply put CODE tags around your code (the # button), or turn AHK file into ZIP and attach.

draftingking
2010-06-02, 07:34 PM
I can't get this script to work in Revit MEP 2011... any help would be great!

Don't know how to open the EXE and edit it to work with MEP '11. I also can't view youtube at work so the video is useless to me...

Alfredo Medina
2010-06-03, 04:13 PM
Attached, please find the .exe file. This time it just looks for "Autodesk Revit", regardless of the discipline, therefore it should work for MEP and Structural. It has been tested in Revit Architecture 2011, only, though. This version uses While conditions instead of loops

This is the code. The previous versions are posted in this same thread, in the first pages. To continue editing this code and compile it, download AutoHotKey and read the help documents.



;########################## Start ###############################################

;;this script was originally posted in Augi by Nicholas Iyaduray
;;then it was modified by David Rushforth
;;this version is a modification by Alfredo Medina
;;this version uses While conditions instead of loops; it has been tested in Revit Arch. 2011.

#SingleInstance force
Revitversion = Autodesk Revit
Excelversion = Microsoft Excel

Msgbox, This program copies cell values from Excel into text fields in a key schedule in 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)`n`n (Modified by Alfredo Medina from David Rushforth's version)


SetTitleMatchMode 1
IfWinnotExist %Revitversion%
{
MsgBox,,, %Revitversion% 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, v#ofRows ym ; The ym option starts a new column of controls.
Gui, Add, Edit, v#ofCols
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 #ofRows =
{
MsgBox,,, You entered 0 rows. `n The program will now exit, 2
ExitApp
}

if #ofCols =
{
MsgBox,,, You entered 0 columns. `n The program will now exit, 2
ExitApp
}

;;set some variables
countrows := 1
countcols := 1
countloops := 1
#ofColsback := #ofcols - 1

;;while the number of loops is less than or equal to the number of rows...
while countloops <= #ofrows
{
;;while the counter of columns is less than or equal to the number of columns...
while countcols <= #ofCols
{
WinActivate %Excelversion%
WinWaitActive, %Excelversion%
Sleep 300
Send {Control down}c{Control up}
if (countcols < #ofcols)
{
Send {Tab}
} else {
Send {Down}{Left %#ofColsback%}
}
WinActivate %Revitversion%
WinWaitActive, %Revitversion%
Sleep 300
Send {Space}{Backspace}{Control down}v{Control up}
if (countcols < #ofcols)
{
Send {Tab}
} else {
Send {Down}{Left %#ofColsback%}
}
countcols := countcols + 1
}
;; end of while for columns
countloops := countloops + 1
countcols := 1
countrows := countrows + 1
}
;; end of while for rows

;########################## End ###############################################

MsgBox, 0, Done., The cells have been copied. `n Please check the data.

ExitApp

;#############################################################################



Important: read INSTRUCTIONS in reply # 71 above.

ijnicholas
2010-06-04, 12:56 AM
Thanks Alfredo for revising the script. I am sorry, I am in a position where I could not revise or test the script.
nicholas iyadurai.

Alfredo Medina
2010-06-04, 02:56 AM
I thank you, Nicholas, for sharing the script. I just put in my two cents.

jfboone
2010-07-30, 03:20 PM
nice program i got it to work for single celled excel files but some of my files have merged cells ex a5,6,7 one big box. Is there any way for it to copy and or make the cell in revit one box as well? Because as it is it enters the value of the merged box in each individual box in revit. If I have a Value of 123 in a merged boxed A567 in excel when it is copies it enters 123 in three separate boxes in revit not one single merged box


Thanks
Jon

Alfredo Medina
2010-07-30, 07:17 PM
I don't know. Probably it does not work as expected for merged cells. Are your Revit cells also merged? I imagine that if the cells are merged in both programs, in equivalent positions, it should work. But, in Revit, only the headers can be merged. If your Excel cells are in some other places other than the headers, then, it won't work.

ashley.ferrand
2010-08-03, 04:20 PM
I am having issues posting to Revit- How should I set up the the schedule? Currently I have all the rows and columns that should be there by assigning room to the schedule....

Alfredo Medina
2010-08-07, 01:28 AM
I think reply # 71 above has enough information. Did you read it?

rinu.bs
2010-10-08, 10:51 PM
hi this is really a good help

i showed it to the cad manager and he also liked it. is there any way that we can put
the excel file in the network drive and make the script run (pointing to the network drive)

example can we import from q:\revit\excel.clx to revit with out opening the file
this will be really helpfull for a lot of people


thanks and keep up the good work

rinu.bs
2010-10-09, 02:21 PM
will this work on revit 2011

arqt49
2010-10-09, 03:20 PM
will this work on revit 2011

That's why it is called "CopyExcel2Revit2011" !

brenehan
2010-10-22, 04:19 AM
use only TEXT instance parameters. (If there is a field that is not set to expect text data, the routine will fail and might cause a crash).

Has anyone got any kind of workaround for this. I have instance angle paramenters which I need to copy across.
I've got the text parameters working fantasitacly.

Is it possiable to have a workaround what I can say in Revit a "Number Parameter" = a "Text paramter"?

Thanks
Brian

Craig_L
2010-10-22, 04:34 AM
Thought I would post this link which is a Revit add-on allowing quick and easy importation of excel tables and data.

Best news is...

it's FREE and it's easy to update the table if the data changes

Not sure if I already posted this link in this thread, its been going a while now!
Apologies if I did already.

http://www.karelcad.com.au/Tools4Revit/Quicktable.htm

brenehan
2010-10-24, 10:23 AM
Thanks Karalon10

Am I right in my use of the tool that I won't allow you to copy data from excel directly into a schedule? It creates a table which it inserts into a detail view, but the perimeters are not available to Revit Parameters and thus schedules? Am I right in this?

Thanks
Brian

Craig_L
2010-10-24, 10:29 PM
To be honest Brian, I haven't had the opportunity or need to use it on a project at this point. I downloaded it and saw the demo video etc and it looks pretty useful, but whatever you discovered there is news to me!

brenehan
2010-10-26, 11:40 AM
So I'm guessing the IDEATE BIM Link will be the next step forward with the Revit - Excel workflow.
http://revitoped.blogspot.com/2010/10/ideate-bim-link-sneak-peek.html

Brian

ijnicholas
2011-02-22, 05:08 PM
I updated the original Copy cells from Excel to Revit.
The evaluation copy of the updated script for Revit 2011 is available at:
http://bim.nichitecture.com/copyexcel.html
hth,

richardarchitect
2011-03-12, 12:15 PM
I updated the original Copy cells from Excel to Revit.
The evaluation copy of the updated script for Revit 2011 is available at:
http://bim.nichitecture.com/copyexcel.html
hth,

Hi Nicholas,

I have a room key schedule that I need to copy to an area key schedule, as some of the fields have half the IBC Building Code as text fields (haha). I went to your web site today and downloaded both your copy excel to revit 2011, and copy schedule key. I also downloaded Alfredo's? Copy2Excel. Alfredo's works perfectly, but both your copy excel to revit 2011, and copy schedule key return "Schedule view needs to be open in Revit". Not quite sure what I'm doing wrong with your programs, as I have both schedules open when using the copy schedule key, and one schedule open and a spreadsheet open when using your copy excel to revit 2011.

I'm using RAC 2011, and I just downloaded the latest files from your nicholas site. Maybe they need to be added as an add-in?, not quite sure.

Edit: I've been thinking about this, and remembered I just installed RAC 2011 update 2 recently, that may be the problem? If so it must be tough for 3rd-party developers to keep up with.

nullingerbinger299826
2011-11-18, 10:11 AM
Hi Nicholas,

I have a room key schedule that I need to copy to an area key schedule, as some of the fields have half the IBC Building Code as text fields (haha). I went to your web site today and downloaded both your copy excel to revit 2011, and copy schedule key. I also downloaded Alfredo's? Copy2Excel. Alfredo's works perfectly, but both your copy excel to revit 2011, and copy schedule key return "Schedule view needs to be open in Revit". Not quite sure what I'm doing wrong with your programs, as I have both schedules open when using the copy schedule key, and one schedule open and a spreadsheet open when using your copy excel to revit 2011.

I'm using RAC 2011, and I just downloaded the latest files from your nicholas site. Maybe they need to be added as an add-in?, not quite sure.

Edit: I've been thinking about this, and remembered I just installed RAC 2011 update 2 recently, that may be the problem? If so it must be tough for 3rd-party developers to keep up with.

Yes, I think they need to be added as add-in otherwise it won't work with etoro copytrader (http://www.brokerreviews.org/forex-trading/etoro-copytrader-openbook/).

arqt49
2011-11-18, 11:17 AM
Yes, I think they need to be added as add-in otherwise it won't work.

They are not addins, but external scripts.
The API does not allow editing schedule views.

ijnicholas
2011-11-19, 07:16 AM
They are not API Plugins. They are crude external scripts and worked fantastically for us. I have not updated them for 64 bit version. That is the reason for this error. We hope to do it in January 2012.
Please try it in a 32 bit computer and let me know if it works....
I apologize for any inconvenience.

ijnicholas
2012-01-11, 10:32 AM
We have updated the scripts for 2011 and 2012. It should work in both 32bit and 64 bit windows now. They are available at:
bim.nichitecture.com/copyexcel.html (http://bim.nichitecture.com/copyexcel.html)
However, we have made the evaluation version to be able to copy only 25 cells at a time.
Regards,

sparkinson195922
2012-07-10, 06:28 PM
This is still not working for us. We are using 64 bit but I have also tried 32 bit and no luck on either.

ijnicholas
2012-07-11, 02:03 PM
I am sorry the utility is not working for you.
Can you be a little more specific?
We have released the 2013 version and more than 300 licenses of this utility are in use currently, and we don't have a single complaint. Please send screen shots, etc as a personal message or contact us through our website.


This is still not working for us. We are using 64 bit but I have also tried 32 bit and no luck on either.