Thursday, 27 November 2008
I appreciate you may have excitedly arrived here from a successful search on Google, wondering how you use the Revit API with schedules. Well I'm afraid its bad news. You can't.
In the new CADsmart Revit skills assessment we wanted to assess a user's ability to create schedules as specified, but met a dead end with a support request on the ADN confirming that with schedules most commands are disabled, and that there is no API that allows access to any cell values in a schedule.
I'm hoping that this might be resolved with the next release. For the moment our assessment asks the user to export the schedule to a delimited text file so our code can access it, which is perfectly legitimate, but a step I'd rather do without.
Monday, 24 November 2008
A simple place to start!
A fundamental requirement of some of the software I build is to open Revit files, present them to the user, ask the user to do some things to it, save and close the file, and then open another. Trying to open a Revit file is where I started many months back and boy was I disappointed; I wondered at this point if the API was going to be able to meet any of our needs. Perhaps my expectations were too high having worked with the mature AutoCAD API.
You can indeed open existing Revit files using the following:
But this doesn't present the file to the user. You can't see it or access it, the file is waiting to be altered programatically, not by a human.
Apparently this functionality is on the wish-list, having been requested multiple times, so until then if you need to open a file for a user, you need to 'botch' it by asking Windows to open it:
Assuming the host machine knows what to do with a .rvt file, then your file will open up into Revit. And then you can use ActiveDocument to manipulate/save/close etc.