missing delConstraint method in python console

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
Joel_graff
Posts: 1293
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

missing delConstraint method in python console

Postby Joel_graff » Wed Feb 14, 2018 12:57 am

It's a minor issue, and maybe it's just that I don't fully understand it, but the Sketcher.delConstraint() function doesn't show up in the intellisense or when I call dir() on a python object.

Specifically, calling the function name in the console yields:

Code: Select all

>>> App.ActiveDocument.Alignment.delConstraint
<built-in method delConstraint of FeaturePython object at 0x4fede88>
but:

Code: Select all

>>> dir(App.ActiveDocument.Alignment)
['Attacher', 'AttacherType', 'AttachmentOffset', 'Constraints', 'ExpressionEngine', 'ExternalGeometry', 'Geometry', 'Label', 'MapMode', 'MapPathParameter', 'MapReversed', 'Placement', 'Proxy', 'Shape', 'Support', '__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'changeAttacherType', 'positionBySupport']
Obviously the function works, but I thought it odd it's hidden from the usual inspection methods...
You can find the FreeCAD Trails workbench for transportation engineering on my github at:
https://www.github.com/joelgraff/freecad.trails
paullee
Posts: 1479
Joined: Wed May 04, 2016 3:58 pm

Re: missing delConstraint method in python console

Postby paullee » Wed Feb 21, 2018 6:31 pm