yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #14280
Re: [Question #517125]: How to set an correct Id of a particle assembly
Question #517125 on Yade changed:
https://answers.launchpad.net/yade/+question/517125
Status: Open => Answered
Jérôme Duriez proposed the following answer:
Hi,
The error says it: you're dealing with list objects e.g. "cube" which namely is a "SpherePack" object (see randomDensePack() doc).
Whereas you have to deal with "Body" objects to access e.g. state.vel.
A possible method is to type:
ids = O.bodies.append(cube) # O.bodies.append returns a list of ids of created YADE bodies
for id in ids: # we iterate on all the particular id in this list
O.bodies[id].state.vel = .... # O.bodies[id] is now one Body object
--
You received this question notification because your team yade-users is
an answer contact for Yade.