← Back to team overview

yade-users team mailing list archive

Re: [Question #703985]: How can I check attribute value of wrapper class?

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

please provide a MWE [1].
E.g. how you use ServoPIDController? standalone, inside O.engines, ...

> How can I check the attribute value of wrapper class?

I **guess** that what you want is the attribute value if an **instance**, not class itself.
There are two approaches, assignment to a variable and using label.
Below are examples, assuming usage of the ServoPIDController in O.engines.

### MWE using assignment
controller1 = ServoPIDController(maxVelocity=2)
O.engines = [
    controller1,
]
print(controller1.maxVelocity)
###

### MWE using label
O.engines = [
    ServoPIDController(maxVelocity=3,label="controller2"),
]
print(controller2.maxVelocity)
###

Cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.