I played around a bit with Python features for BOLTS. The idea was to explore the possibility of encapsulating the parts from BOLTS in a feature and exposing the parameters as properties, to allow to change them afterwards. So instead of deleting a M3 washer and adding a M4 washer one could just select the M3 washer and change the size by changing a property.
It was surprisingly easy to get some very rough proof of concept working, but there is something that I could not figure out. If you have a App::PropertyEnumeration, you can set the possible choices by assigning a list to the property:
Code: Select all
obj.addProperty("App::PropertyEnumeration","Sizes,"BOLTSFeature","Size of the washer")
setattr(obj,"Sizes",["M3","M4","M5"])# or obj.Sizes = ["M3", "M4", "M5"]
And then I am not sure, whether having the parts from BOLTS in form of a Python feature is a good idea anyway. On the one hand it is nice to be able to change the parameters of a part via the standard property mechanism, but on the other hand I fear the interoperability problems that arise. If I understand correctly, BOLTS would need to be available to be able to open fcstd files containing such parts, and one would need to be careful to preserve backwards compatibility. This seems like a lot of complications for a relatively small gain.
What do you think?
OS: Ubuntu 13.10
Platform: 64-bit
Version: 0.14.3468 (Git)
Branch: master
Hash: 79efe68e2581b350e04fdaebbd4a65ce3105a54a
Python version: 2.7.5+
Qt version: 4.8.4
Coin version: 4.0.0a
SoQt version: 1.5.0
OCC version: 6.7.0