← Back to team overview

yade-users team mailing list archive

Re: [Question #244984]: Clumps,sphere and walls IDs

 

Question #244984 on Yade changed:
https://answers.launchpad.net/yade/+question/244984

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Behzad,


> for i in O.bodies:
>          if i.isClump:
>              O.bodies[i.id].shape.color=(.1,.7,.9)
>          else:
>              O.bodies[i.id].shape.color=(1,1,1)
>
> Changes the color of all bodies (yes, including the wall) to  (1,1,1)
> means that it does not consider them as clump members.
>

actually you already answered yourself :-) try something like:

for i in O.bodies:
  if i.isClumpMember: # different property
    i.shape.color = whatever # you can use directly i.shape instead of
O.bodies[i.id].shape, but the result should be the same
  else:
    whateverElse

cheers
Jan

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.