Altium’s Auto-Router is a pain, it doesn’t produce usable results even in trivial scenarios. I had the idea of scripting the routing of my board and found, that Altium supports scripting. However, they do not offer scripting in my preferred language (Python) and running the scripts seems to require Altium to be installed and running, which makes it pretty useless due to the lack of a Linux version of Altium. Looks like I have to hack some file manipulation together myself. So, how does Altium store data?
Altium uses Microsoft’s OLE2 Compound Document format for all it’s documents. I am having problems using the Python library for OLE documents, but Apache offers a Java library, that seems to be working well: org.apache.poi
Therefore for packing and unpacking the documents, I will make use of simple Java applets at first.
At least some of the content of Altium documents is text in a key-value associative manner, therefore it makes sense to use JSON as an intermediary format. Also, because this allows for JavaScript-based EDA tool generation lateron.
What has been done?
- Dejan Stankovic has demonstrated, that Altium schematics can easily be translated between OLE and JSON using Apache POI.
- Martin Panter has implemented a Python script to convert Altium schematics to SVG.
- TheSourcerer8 implemented an Altium-to-KiCad converter in Perl.
What’s to be done next?
- Working unpacker and re-packer need to be implemented.
- The combined knowledge of the three projects above should be boiled down into a well-commented library, which parses the JSON into Altium objects, that in turn may then be manipulated by scripts.
Repository:
Pingback: #BlogBlick No. 6 | Plaintron Blog