I need to do some calculations with the material systems assigned to 3d elements. To get to those values (directions) I need to first get the MCIDs from a collection of elements.
in python, I can do:
import hm
import hm.entities as ent
elems = hm.CollectionByInteractiveSelection(model,ent.Element)
elem_system = {}
for e in elems:
elem_system[e.id] = e.MCID.id
return elem_system
That loop takes about 0.015s per element to run. It should be evident that this running time is unacceptable for any decent sized model. That is just to access the relevant information.
However, in tcl one can do: set mcids [hm_getvalue elems mark=1 dataname=MCID] and get to that data fast. In fact, I'm doing that, dumping the data to a file, and open it in python. It is very far from ideal.
I have not been able to find an equivalent pattern in python. hm_getvalue seems not to be in the API.
Is there something with a similar performance in python?