hexagon logo

ADAMS Python, more in-depth examples?

​I am very excited about opening up the python interface for ADAMS 2017, but as I dig into the language, I'm finding lots of ways to crash view, and not much documentation.
 
The 2017 documentation is good at giving a very short introduction, showing how to create and modify objects, but these are frankly trivial examples and don't actually use much of the python language.
 
For example, if I want to iterate through all the parts in my model, I imagine I would do something like
 
prtNames=list()
for prt in Adams.getCurrentModel().Parts.iteritems():
  prtNames.append(prt.name)
 
I have tried several iterations of this, and most of them either throw an error or crash Aview (this one then crashes). Can anyone point me to some more complex examples, which take advantage of python coding patterns?
 
Crashing suggests the code is fragile, so I need more guidance than the help() command in how to do things as help() reveals things that are broken, like the iteritems function.
Parents Reply Children
No Data