← Back to team overview

yade-users team mailing list archive

Re: [Question #267724]: Call a ForceEngine attribute in Shop

 

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

    Status: Open => Answered

Kneib François proposed the following answer:
You don't need shop there.
Use this macro is your engine : YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(...), where CTOR can be empty.
So define your method in your class, then invoke the above macro, where the "PY" argument can be (I assume your method is called "test" :
.def("test",&HydroForceEngine::test,"Get particle deformation")
.def will link your c++ method to the python scope. I recommend you to look at TesselationWrapper.hpp for more details, there is a list of examples.
After that, call your method in Python with : O.engines[?].test(...)

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