Export boundaries of Revit Rooms to SVG, and use them in PowerBi

Hello Everybody,

I’m trying to develop a use of Dynamo combining the power of a Revit model with Power BI.

The idea is to transform a revit Plan by exporting it to SVG, then use The Synoptic Panel In Power BI to link the data in its original place.

https://powerbi.microsoft.com/en-us/blog/visual-awesomeness-unlocked-using-the-synoptic-panel/

https://okviz.com/synoptic-panel/

I tried to use the “Illustrator” package that is the only one I saw that should export Dynamo geometry in svg
But this give me that error :

I think that maybe the package is not maintained

I also found this : https://github.com/jeremytammik/SvgExport
But I don’t understand How I could use it in this workflow

So googling this issue, I found that a SVG file is kind of an XML that can be edit with Notepad. So maybe this can be an opportunity to export using “lunchbox” package but I’m not sure if this is possible ?

What do you think ? Is there an easier way to “convert” a plan in SVG using the room boundary lines ?

Thank you for your answers

2 Likes

you might find this useful:

Hello Michael, thank your for your answer.

In fact, this is the package I used by using the node SVG.export in my example… but the result is null

Null is just a void which is in fact the output of the node in dynamo

Hi Jonathan, So you think that this should’ve been worked this way ?

https://sea2.discourse-cdn.com/business6/uploads/dynamobim/optimized/3X/4/8/48e1e33469d4ee0cc7a771e4951f55106132080b_1_690x385.png

I couldn’t find any geometry in the generated .svg file…

Moreover, the problem is that with this method, I cannot give any ID information to the geometry of the svg file

Yes it should very well, you just need to make sure you read what type of data the inputs need, e.g. the geometry input:

But you are right, .svg does not support “ID’s” as pr. say, you could use .csv, i believe PowerBI can work with comma separated files, and this way you can add ID’s and headers to your geometry before export.

Were you able to do it finally ?

it does work- but I think you need to be careful with units- depending on what application is used to view the SVG, it might not be able to comprehend something like 100,000 pixels wide

I’d suggest it is probably easier to create a vector PDF in Revit, then use something like Inkscape to scale/tidy it up and convert to SVG for use in PowerBI
(note that Inkscape SVG is different to standard SVG)

image

hi @Andrew_Hannell thanks for sharing these images.

I am trying a similar method but my file generated has nothing in it
am I doing something wrong

thanks.

try looking at the file in something like Notepad- it is fairly human-readable
If that works, then try Inkscape or similar

Trying to view it in a browser can be a problem depending on size/scale- your geometry is probably 1000 miles off the edge of the window

Thank you for all the answers.

So it seems that the export works for lines using the good scale and with attention of flattening all the lines in one list.

The problem is that, for using The OkViz’s Synoptic Panel for PowerBI in the most efficient way, we should

  • export polygons instead of lines ,
  • connect and implement an “ID” field of these polygone that connects the data to the geometry.

For example, if you look at this file that is given for example in the Gallery of the synoptic designer OkViz, each entity ( or room boundary line) is described like this :

<polygon id="_4" title="" points="878,187,878,263,707,263,707,187" />

Do you think that we can have this structure using a PDF export from Dynamo ? Or maybe a sequence of xml nodes ?

thank you so much It works…!

if your happy to use python, this should work for you

2 Likes

Hello,

How did you get the “SVG Export” node in Dynamo?

I cannot find it when I search for Packages.

Thank you

Hello Joaquim,

The SVG.Export node is in the “Illustrator” Package. You can find it in the package manager.

1 Like

Hi

I tried to use Adam script but to re-adapt to export Areas by calling the relative API methods but not sure if it’s feasible… I have no idea how to select the Area Plan first - any idea ?

I’ll set myself a reminder to look at this when I finally get Revit, dynamo installed. New job has very strict IT governance and it’s taking a while…

1 Like

Hi

I i think I managed to solve - was very easy actually. Just need to apply RoomFIlter instead of AreaFilter and use areas instead of rooms for boundaries!

However I get an error on some floors at line 282 " File “”, line 280, in
StandardError: Unable to create Line. Points are likely coincident "

What can be causing the issue ?

Points are coincident when they are in the same location, so a line between them would have zero length, tricky to really say more at the moment, I am interested for this and will look at developing something but it’s going to take a while before I get Revit installed, at least with 2020 dynamo is baked in as an add-in rather than something else I need to convince my it fits to install…

1 Like