Hi,
As always thank you for your help!
I am trying to get this simple class method to run but getting an error for missing arguments. I am sure I am giving an argument of partSel.Object but...
partSel = FreeCADGui.Selection.getSelectionEx()[0]
hole = PathScripts.PathCircularHoleBase.ObjectOp.circularHoleFeatures(partSel.Object)
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: circularHoleFeatures() missing 1 required positional argument: 'obj'
This is the help file doc
def circularHoleFeatures(self, obj):
'''circularHoleFeatures(obj) ... drilling works on anything, turn on all Base geometries and Locations.'''
return PathOp.FeatureBaseGeometry | PathOp.FeatureLocations
Any help is much appreciated thanks.
TypeError: circularHoleFeatures() missing 1 required positional argument: 'obj'
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 1
- Joined: Fri Jan 22, 2021 9:30 pm
-
- Posts: 54
- Joined: Sat Dec 19, 2020 11:55 pm
Re: TypeError: circularHoleFeatures() missing 1 required positional argument: 'obj'
I don't have PathScripts in my FreeCAD Python console. Which version and which workbench are you using? Did you use any import statements?
My best guess is that you're calling the definition of the method, which is actually a function of two parameters, self and obj, when you should instead be calling it on an instance, e.g. something like
My best guess is that you're calling the definition of the method, which is actually a function of two parameters, self and obj, when you should instead be calling it on an instance, e.g. something like
Code: Select all
App.ActiveDocument.MyPathObject(partSel.Object)