View Full Version : Import excel cells within Revit schedule
2005-06-11, 06:49 PM
There are many examples of code we can get via the codes samples and draft.net folders at autodesk web site. It seems quite amazing....I don't have the smallest idea about the way one's could implement what I have in mind (very easy in my mind maybe not in reality) that is to import excell data within Revit schedules. Here (in France) we always deal with excel to communicate with the client (public/private). I mean when we receive a huge excel sheet whith all the areas inside I can tell that we dream about a kind of "Import excel external tool"..
Any code or info about this?
The example that exports data to excel shows you the basis for going the other way. I'd google for general .net excel examples as well.
2005-06-18, 01:17 PM
I can't understand how to make this operation... Inserting a row within a schedule!!!
I mean the export sample seems "easier" to build than an import command. I have the feeling that the API allows to retrieve elements properties but it's not so easy to create elements. There are some indications about BuiltInParameters from the RevitApi help but the list is far to be complete, and as a very anonym user I can't suscribe to ADN to be informed...
2005-06-18, 03:30 PM
...I can't understand how to make this operation... Inserting a row within a schedule!!!...I believe FK answered this in another thread?
Note that as of this release there is no interactive going back-and-forth between Revit and the API program.
Technically data isn't part of a schedule, it is part of objects and schedules display the data. The exception is calculated parameters that exist only in a schedule. Even those are not fields you act on, they act when other data is supplied.
So if you want to fill in a value in a schedule you really need to fill in the data from the object. Within the Revit interface a schedule allows you to enter data but it wouldn't surprise me at all if a schedule is inert from a programming perspective?
Adding a row to a schedule is a command you see on the options bar but that is tied to Rooms for example and it really is creating an object as well. A schedule key appears to be the only data row that you can add that doesn't specifically involve a new physical object in Revit.
2005-06-18, 07:34 PM
Thank you for the wise advice...
And sorry for repeating myself. Maybe those things are a little bit too complex for me!
interactive going back-and-forth between Revit and the API program.
What fedor means here (I think) is that you can't access the Revit document perform an operation then get an updated document from the API. You need to run the command again to get the new document.
Remember Autodesk have made it clear this version of the API is strongly orientated for structural analysis. Expect to see more general functionality exposed via the API in future versions (we hope).
2005-07-01, 12:19 AM
This thread relates to a similar thread in Revit Building General
As I understand it the Structural API can modify the objects already defined in the model either by replacing the objects or by updating the parameters (I am not sure which)
This means that the API must be able to control the objects or the object parameters.
As the schedule reflects the object parameters then adding a line would be similar to adding an object (depending on whether the line in the schedule is subject to filtering)
Changing the values in the schedule would be equivalent to updating the parameters of the object.
It would therefore appear that the API should be able to do this but I guess like everyone else we need some examples from Autodesk
If anyone can provide details on how to do this it would be greatly appreciated.
We implement "read" portions of the API first, and then slowly and warily tread into "write" because Revit models are complex interconnected beasts that you can't just go ahead and modify from the inside.
For instance, a schedule is not a sheet of numbers - it's a view of the model. So if you insist on putting some numbers in, you've got to change the model to reflect them, and that has to be meaningful.
Powered by vBulletin® Version 4.1.11 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.