vocx wrote: ↑Mon Oct 07, 2019 5:40 pm
By the way, when you are building paths, it's best to use Python's os.path functions. I would also avoid variables with double underscores as these are typically reserved for special internal properties.
Found there is something even better a few weeks ago ... https://docs.python.org/3/library/pathlib.html On my own code I have switched to pathlib, but on such a big code base as FEM it would be quit some work and for sure some problems will come up. Thus I leave it for now with os.path even if we have in FEM on windows some paths with mixed slash and backslash. I works without problems but I do not like it ...
If I would do something new I would take pathlib right from the beginning.
bernd wrote: ↑Mon Oct 07, 2019 7:28 pm
...
If I would do something new I would take pathlib right from the beginning.
I guess that's fine if you know you won't use Python 2 at all. But also, pathlib looks a bit over engineered (object oriented of course). I guess it's fine if you are going to handle a lot of paths, but if you are doing simple concatenation to get just one file I think it's overkill, and os.path is simpler.
In a similar way as the reaction forces, I'd lice to animate the reaction torque over the joints. MBDyn gives the torque too, but i don't have many ideas on how to animate a torque. Forces are simple. Length of the line is force magnitude, and line direction is force direction. Does anyone have an idea how to animate a torque? Can one animate arcs with FreeCAD, as I do with the lines for the forces? Suggestions?
Cheers.
Last edited by Kunda1 on Thu Oct 10, 2019 5:15 pm, edited 1 time in total.
Reason:added video tags
When the user changes a property of a scripted object, the "onChanged" method gets executed. Is there a way to change the values of other properties of the same object, from within the "onChanged" method? I want the "onChanged" to do some calculations using the value of the changed property, and update other properties with the results. How can I achieve this?
josegegas wrote: ↑Fri Oct 25, 2019 5:45 am
When the user changes a property of a scripted object, the "onChanged" method gets executed. Is there a way to change the values of other properties of the same object, from within the "onChanged" method? I want the "onChanged" to do some calculations using the value of the changed property, and update other properties with the results. How can I achieve this?
You can do this but you have to add some code to stop recursive calls of the onChanged method.
josegegas wrote: ↑Fri Oct 25, 2019 5:45 am
When the user changes a property of a scripted object, the "onChanged" method gets executed. Is there a way to change the values of other properties of the same object, from within the "onChanged" method? I want the "onChanged" to do some calculations using the value of the changed property, and update other properties with the results. How can I achieve this?
Is this an FEM question or a general python programming question?