Closed ShamanTcler closed 10 months ago
The current import feature only supports the FreeCAD toolbit format (.fctb). Library import is not yet directly supported, which is probably what you would want. The CLI tool also has a Camotics import feature, but that is not yet exposed in the UI.
To add an additional import format, the following things would need to be done:
btl/serializer/
. The serializer would probably look similar to camoticsserializer.py, but you can leave out unsupported methods. In other words, if you want to support import only and no export, you don't have to implement any serialize*()
methods.btl/ui/library.py
to have an extra menu item "Import Library", and a callback method "on_import_library_clicked()" to go along with it.That would be pretty much it. I guess ideally there would be a dialog to preview the import, but that may be optional.
Actually just implemented the UI for the Camotics importer, so now it's even easier to add your own importer:
btl/serializers/
. For example, whitesideserializer.py
. The serializer would look similar to camoticsserializer.py, but you can leave out unsupported methods. In other words, if you want to only support import and no export, you don't have to implement any serialize*()
methods.btl/serializers/__init__.py
Done. It should automatically appear in the UI, meaning, when you click "File -> Import library", your serializer should show up in the file filter dropdown box of the file selector.
I was looking for your import file format specs, and don't see them. (I did look under docs)
I would like to bring in catalogs from Whiteside & Bits&Bits.
Is there a JSON or such format you prefer? ( I already can make FreeCad tools and libraries but your BTL stuff is a mystery)
I know in a previous chat I said I was using CSV or Excel from vendors, because frankly most vendors don't understand anything more than that.