FeaturePython / Scripted Object question

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

FeaturePython / Scripted Object question

Post by Joel_graff »

I have a custom feature python object with a custom function and property. If I create the object, the property is exposed, but the function is not. I have a need to run a FeaturePython object function directly from outside the object itself (rather than letting it be called from execute() or some other event callback).

As I understand FPO's, I don't think that's possible. But just in case I'm wrong, I thought I'd ask.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
Chris_G
Veteran
Posts: 2598
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: FeaturePython / Scripted Object question

Post by Chris_G »

You should be able to call your function through the Proxy object :

Code: Select all

my_FPO.Proxy.my_function()
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: FeaturePython / Scripted Object question

Post by Joel_graff »

Chris_G wrote: Mon Feb 11, 2019 3:06 pm You should be able to call your function through the Proxy object :
Gotcha. Works as expected. Thanks.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
Post Reply