I think Selectable is a standard property only for Part::Feature but not for App::FeaturePython.
The Selectable property is added by ViewProviderGeometryObject. So, it's not only available for shapes but also for mesh, FEM meshes or point clouds.
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","myObj")
obj.ViewObject.Selectable = False
You can use the next type in the class hierarchy:
Code: Select all
obj = FreeCAD.ActiveDocument.addObject("App::GeometryPython","myObj")
obj.ViewObject.Selectable = False
I believe it's because you are using Part:FeaturePython and I am using App:FeaturePython. What is the difference?
A Part:FeaturePython and its view provider has implemented a few more things compared to an App:FeaturePython.
Also when I change App for Part, the Selectable property shows up and the tree item as well, but the object won't show in the 3D view anymore.
At this point you still have to set a (proxy) view provider. If you don't want to assign a user-defined proxy view provider you have to set the Proxy property of the view provider to anything other than None. This is to trigger the internal initialization.