This is great !
Thank you much Russel.
Proposed GUI scripting support and other improvements - PR #4797
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Proposed GUI scripting support and other improvements - PR #4797
Many Thanks Russ4262.
It works in:
Many thanks.
Regards
Carlo D.
It works in:
As a test I create a CreateVcarve modifying methods, like you have done for CreateProfile, I checked and is working, provided all things are correct like a proper Tool:OS: Artix Linux (openbox)
Word size of FreeCAD: 64-bit
Version: 0.20.26498 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 1895593)
Hash: 18955931c7f0926a4cd9d2719be5a433b49ae56e
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: Italian/Italy (it_IT)
Code: Select all
def CreateVcarve(parentJob=None):
"""Create Path Vcarve operation with GUI support, but without initial GUI interaction.
Allow for parent job assignment at instantiation."""
PathVcarve = PathVcarveGui.PathVcarve
PathUtils = PathVcarve.PathOp.PathUtils
res = PathVcarveGui.Command.res
gitVersion = getVersion()[2]
# print("git version: {}".format(gitVersion))
if gitVersion > 24291:
obj = res.objFactory(res.name, obj=None, parentJob=parentJob)
else:
if parentJob:
obj = doc.addObject("Path::FeaturePython", res.name)
doc.recompute()
parentJob.Proxy.addOperation(obj) # add new operation object to job object
hold = PathUtils.addToJob
PathUtils.addToJob = addToJob2 # Overwrite original function with improved
obj = PathVcarve.Create(res.name, obj=obj)
PathUtils.addToJob = hold # restore original function
else:
obj = res.objFactory(res.name, obj=None)
obj.ViewObject.Proxy = PathOpGui.ViewProvider(obj.ViewObject, res)
obj.ViewObject.Proxy.deleteOnReject = False
obj.ViewObject.Visibility = False
return obj
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/