ArjenSchwarz / awstools

A little application to help with more complex AWS functions
MIT License
26 stars 4 forks source link

Drawio format usage #11

Open Aldekein opened 2 years ago

Aldekein commented 2 years ago

Hello,

I'm struggling with the exported Draw.io file (-o drawio option). The service now is called https://app.diagrams.net/ and no matter what I did, the diagram is not imported. The error I get, while trying to open is Not a diagram file.

I tried to export a random drawing from app.diagrams.net to see what's the difference and it's a completely different format, an XML with <mxfile><diagram> entities that contain the Base64-encoded binary data. How could I use the awstools output then?

ArjenSchwarz commented 2 years ago

Hi @Aldekein, apologies for the late response. I'm currently on holiday and don't check my email much. I'm aware that draw.io has been renamed and will at some point update the output to match it. Unfortunately I haven't figured out the right name yet as diagram is a bit too generic since I'll want to support other formats as well.

Anyway, as for your specific issue. The tool doesn't actually generate the XML files you can open in diagrams.net, but instead it generates a CSV file that you can import by going through the menu Arrange -> Insert -> Advanced -> CSV. There you get a text field which you need to completely replace with the contents of the generated CSV file. Once you then press import the generated items will be added to the diagram you have open. This has the benefit that you can import multiple times into the same diagram (although to be honest my main reason for doing it like this was that it was a lot less work then replicating the generation of building the XML files).

I am leaving this ticket open for now as obviously my documentation isn't clear enough about and I will need to fix that, so thank you for pointing that out.