How to set material orientation with hypermesh 2025 python API?

When I use the record function this is what I get
import hm
import hm.entities as ent
def run():
model = hm.Model()
collectiona = hm.Collection(model, ent.Element, False)
collectionb = hm.Collection(model, hm.FilterByEnumeration(ent.Element, ids=[*range(1,201)]))
model.markintersection(collectiona=collectiona, collectionb=collectionb)
model.retainmarkselections(mode=0)
model.retainmarkselections(mode=0)
model.normalsoff()
model.vectorsoff()
Which doesn't work. Is there a command to do it using the API or it isn't implemented yet?
Answers
-
Solved via support request
When trying to use the recorder while assigning material orientation when using the composites browser, the recorder does not actually record the commands.
In any case, what this operation does is assign a coordinate system or a direction given a specific angle to the selected elements.
Both of these options can be done directly on the elements through the entity editor browser. And when doing them through the entity editor, these operations can be recorded by the python recorder:
In this way, the commands to change the orientation of elements (equivalent to assigning orientation to the material through the composites browser) by assigning a system or an angle using python are respectively:
# Assigning a system with ID=_SystemID_
elements_collection.set_items('ThetaMCIDopt', 2)
elements_collection.set_items('MCID', ent.System(model, _SystemID_))
0