PDA

View Full Version : Link Revit to Access/SQL/Intranet - 2 way



Mike_Millest
2008-01-17, 10:20 AM
Hi
We have developed a VBA bi-directional link from AutoCAD to Access or SQL which in turn allows drawings and their data to be manipulated from an intranet site.
I have programming / developing experience in ACAD but none in Revit.
I want to do the same with Revit. It will hold 2 benefits -
1. Opening the way for a good FM package (Sorry FM Desktop doesnt cut it)
2. It will allow all Revit Data to be stored in an external shared database allowing cross-model reporting functionality across. It opens the way to inturn reduce the size of the Revit models.

Now, In AutoCAD we use x-data, Is there a tag of some description in Revit we can use?

Is there anything available that has been done?

This is a new user on a first post, sorry if I have broken any protocols......

regards

Mike Millest - mike@spacedatatechnology.com

truevis
2008-01-17, 01:18 PM
...
Now, In AutoCAD we use x-data, Is there a tag of some description in Revit we can use?...
If you want to go the DWG path:

When you export to DWG with the room polylines, they have some xdata about the rooms in them.

(cdr (cadr (assoc -3 (entget en (list "REVIT")))))

on the LWPOLYLINE entity "en" gives you it.

I have more code if anyone wants it.

Mike_Millest
2008-01-17, 01:58 PM
Thanks for this. Really want to interrogate the Revit entity directly rather than the export. What handle does Revit Use. I stand corrected but I think yours is for a LW polyline after export. I dont want to export, I want to create a live link to the family parameter so if it is a piece of furniture, I could interrogate the Make and Model and cost listed in the revit model?

aaronrumple
2008-01-17, 02:14 PM
Manufacture, Model and Cost are parameters of all Revit objects. Revit has a limited API and you can't just make things up as you like in AutoCAD for your own needs. You can add new parameters to objects, but you have to work within the framework of what Revit offers. Note that drafted linework has no data associated with it.

bclarch
2008-01-17, 03:29 PM
Mike,
You might want to try posting in the API forum. The programming gurus are more likely to visit there.

Jim Merritt
2008-01-27, 08:58 PM
Thanks for this. Really want to interrogate the Revit entity directly rather than the export. What handle does Revit Use. I stand corrected but I think yours is for a LW polyline after export. I dont want to export, I want to create a live link to the family parameter so if it is a piece of furniture, I could interrogate the Make and Model and cost listed in the revit model?

Mike, actually Revit's API is getting much more open as of the 2008 release. I'm sure the 2009 release will include even more. The Revit SDK has a sample program in it exporting through ODBC to what ever database you want. As long as you setup your parameters in the families as shared, you can export any of that data.

Your certainly right that you can reduce the model size significantly by keeping linked data in an off line database.

We have not dug too deeply into our implementation of this link yet and are still setting up our Revit standards, but I'm really looking forward to digging into this end of Revit.

--Jim

truevis
2008-07-30, 01:27 PM
Perhaps a parameter that contains a pointer to a database. AFAIK, the equivalent of AutoCAD's XData in Revit would just be user-created parameters on families.

Parameters should be accessible programmatically with the API.