Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

html to xml in c#

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
Ning_Zhou
993 Views, 11 Replies

html to xml in c#

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?

11 REPLIES 11
Message 2 of 12
jeremytammik
in reply to: Ning_Zhou

Dear Ning,

 

The most elegant method is to use XSLT, aka XML transformation:

 

http://en.wikipedia.org/wiki/XSLT

 

http://www.w3schools.com/xsl

 

It is very cool and braintwisting.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 12
Ning_Zhou
in reply to: jeremytammik

thanks Jeremy for your quick reply.

to my knowledge, XSLT is used mostly to transfer from XML to other document like HTML, don't know if it's a good idea to transfer from HTML to XML?

i assume it's not API-accessible on the fly of Revit interference checking result, isn't it?

Cheers,
Ning
Message 4 of 12
jeremytammik
in reply to: Ning_Zhou

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 12
Ning_Zhou
in reply to: jeremytammik

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.

Message 6 of 12
jeremytammik
in reply to: Ning_Zhou

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 7 of 12
Revitalizer
in reply to: Ning_Zhou

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




Rudolf Honke
Software Developer
Mensch und Maschine





Message 8 of 12
Ning_Zhou
in reply to: Revitalizer

thanks Revitalizer for your great idea even though i'm not quite get it yetSmiley Embarassed.

 

what do you mean "doing the collision calculation on yourself"? you mean doing customized warnings?

Message 9 of 12
Revitalizer
in reply to: Ning_Zhou

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




Rudolf Honke
Software Developer
Mensch und Maschine





Message 10 of 12
jeremytammik
in reply to: 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  🙂



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 11 of 12
Ning_Zhou
in reply to: Revitalizer

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.

Message 12 of 12
Revitalizer
in reply to: Ning_Zhou

Hi Ning Zhou,

 

in this case I wish you good success in postprocessing the html file.

 

 

Cheers,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community