Assembly2: Constraints invisible

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
tomerp
Posts: 14
Joined: Thu Jan 04, 2018 1:41 am

Re: Assembly2: Constraints invisible

Post by tomerp »

Team
I am trying to make a short cut in assembly2 such that when you press on the constraint on the tree view, you will get that contstraint highlighted in the 3d view of the model itself.
I am trying to capture, in the python side (inside the /Mod/FreeCad_Assembly2 codebase) the click on the tree widget and then highlight it from the python side.
Can any one tell me how to capture what is selected in the tree view, and handle it in python?

so just to recap here is what i want to do from the Python code in FreeCAD_assembly2
- mouse is single clicking on an item in the objects tree
- assembly2 python code detects a constraint is clicked
- assembly2 highlights the objects that this constraint applies to, in the 3d view.

appreciate some hints on how to do it.

Thanks!
Koemi
Posts: 150
Joined: Thu Dec 28, 2017 11:13 am
Location: The Netherlands

Re: Assembly2: Constraints invisible

Post by Koemi »

Hi tomerp,

maybe some hints in this topic?

https://forum.freecadweb.org/viewtopic.php?f=20&t=28128
Post Reply