not exactly the Revit API question, but kind of related due to the fact: Revit interference checking will only produce report in html format, but xml will be great for post-processing!
any recommendation (either dll or source code) will be very much appreciated.
besides, after running interference checking, Revit must store that information on the fly, is it possible to directly access that information?
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Dear Ning,
The most elegant method is to use XSLT, aka XML transformation:
http://en.wikipedia.org/wiki/XSLT
It is very cool and braintwisting.
Cheers,
Jeremy
Dear Ning,
Two points - well, three:
1. basically, XSLT is used to transform XML to XML.
2. Since HTML is a subset of XML, both your view and my suggestion are covered.
3. Oh yes, I would certainly assume that you can drive an XSLT processor from a Revit add-in.
I am certain that can be done.
An XSLT processor is just a normal executable, reading and writing XML files and doing it thing.
Cheers,
Jeremy
i'll give it a try, thanks Jeremy.
what i mean API-accessible on the fly is: after running Revit interference checking using standard UI but not exporting to HTML at all, there must be result there within Revit database, can API directly get access to that result? so i can skip the followings: export result to HTML,convert to XML, etc.
Dear Ning,
I am not aware of any possibility to hook into those resulrts in memory.
I am looking forward to hearing what you find out about XSLT, and what processor you decide to use.
They are available in C++ source code, or were, last time I had a look.
I never looked into any C# or .NET wrappers for them...
Cheers,
Jeremy
Dear Ning Zhou,
what about doing the collision calculation on yourself ?
In this case, you could export the results in any format.
Plus, you would have more data than is contained in the HTML: penetration points, angles and so on.
Best regards,
Revitalizer
thanks Revitalizer for your great idea even though i'm not quite get it yet.
what do you mean "doing the collision calculation on yourself"? you mean doing customized warnings?
Hi Ning Zhou,
no, I don't mean just customized warnings.
I really meant to calculate collisions by yourself.
In fact, if there is access to all geometric objects, there can be found intersections between them.
You could find intersections either by raytracing or by checking the elements' bounding boxes and so on.
I agree that this could become a major task, but it is doable at all.
Best regards,
Revitalizer
... especially since all the main components are provided by the Revit API, specifically (i) access to read the elements' solids and (ii) an API call to calculate intersections between them. What more do you need, except some administrative details 🙂
i see what you mean, it's doable but huge task for sure, well, currently i'm thinking to use Revit interference checking function to its full capacity, for instance, remove similar clashes by post-processing xml, produce nice Revit report using customized 3D grids which will automatically matching w/ section box, etc.
Hi Ning Zhou,
in this case I wish you good success in postprocessing the html file.
Cheers,
Revitalizer