Hello, everyone.
I am creating a panel. I want to update the view whenever the value is changed, like the 'PartDesign-pad' panel.
How to add the update view using python API? Thank you!
How to update view using python
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: How to update view using python
To update changes whenever something happened (a button pressed in the panel) in the user interface, you need a viewprovider.
- Create a custom viewprovider and connect it to an object: https://wiki.freecadweb.org/Viewprovider.
- Connect buttons in your panel to slots in your viewprovider.
I think it should work, but I did not test it.
- Create a custom viewprovider and connect it to an object: https://wiki.freecadweb.org/Viewprovider.
- Connect buttons in your panel to slots in your viewprovider.
I think it should work, but I did not test it.
- ebrahim raeyat
- Posts: 625
- Joined: Sun Sep 09, 2018 7:00 pm
- Location: Iran
- Contact:
Re: How to update view using python
you can view my implementation for creating steel column section:
https://github.com/ebrahimraeyat/momen/ ... on.py#L330
the section update in this function:
https://github.com/ebrahimraeyat/momen/ ... on.py#L356
https://github.com/ebrahimraeyat/momen/ ... on.py#L330
the section update in this function:
https://github.com/ebrahimraeyat/momen/ ... on.py#L356
Re: How to update view using python
Hi
mario
Code: Select all
Gui.updateGui() # rafraichi l'ecran
# or
FreeCADGui.updateGui() # rafraichi l'ecran
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.