Probably most of these problems are related to the way information are store in the object.
For me it all about documentation, there is way, so a solution exist.
many of the code showed as:
Code: Select all
App.getDocument('Unnamed').getObject('Sketch002').Support = (App.getDocument('Unnamed').getObject('panel2pad'),['Face2',])
could be rewrite in a more readable manner as:
Code: Select all
DOC = App.getDocument('Unnamed')
object1 = DOC.getObject('Sketch002')
object2 = DOC.getObject('panel2pad')
object1.Support = (object2, ['Face2',])
That may appear too verbose, but as you could reuse
DOC object1 and
object2 further in the code without typing too much, and without having the overhead to retrieve every object everytime you wnat, as the reference is stored once, and the operation to find the object in the document is done only one time, same for
DOC, you will force FC to retrieve two time same object doing a search.
IMHO it seems not a clever way to use "machine cycles".
You could ever find the face descriptor using index of
Faces property, and compose a simple string using some more efficient ways than "string concatenation" (+ operator), maybe:
is more short and readable than:
For other considerations, about the API, it will be very interesting to hear something from developers, but actually I prefer that they concentrate on integrating some other most important things, that "helper functions".
Recently I have seen @wmayer very active in "fixing bugs" and solve some questions making very quick commits, so probably developers have done things more productive.
Not citing that "Face order" is extremely arbitrary as it depends on what the "3d engine" is returning as "face index", and it is related to the infamous "TNP", so probably a more clean solution is coming that will permit to store a "reference" similar to
Face.Label in the "near" future. (From some post RT is working, but having some problems in "syncing" his code with "master").
Regards
Carlo D.