Can I use an instance of an object created with a custom operator to run other custom methods in the same class? In my Python script, I would like to use the selected object to choose a method from the appropriate class.  Here is an example that explains what I want to do:
import bpy

class CheckShape(bpy.types.Operator):
    bl_idname = &quot;myops.check_shape&quot;
    bl_label = &quot;Check Shape&quot; 

    def execute(self,context):
       obj=bpy.context.active_object
       print(&quot;what shape is this?&quot;)
       obj.check_shape()
       return {'FINISHED'} 

class DrawCube(bpy.types.Operator):
    bl_idname = &quot;myops.draw_cube&quot;
    bl_label = &quot;Draw Cube&quot; 

    def execute(self,context):
        bpy.ops.mesh.primitive_cube_add()
        return {'FINISHED'} 

    def check_shape(self,context):
        print (&quot;a cube&quot;)
        return {'FINISHED'}

class DrawCylinder(bpy.types.Operator):
    bl_idname = &quot;myops.draw_cylinder&quot;
    bl_label = &quot;Draw Cylinder&quot; 

    def execute(self,context):
        bpy.ops.mesh.primitive_cylinder_add()
        return {'FINISHED'}

    def check_shape(self,context):
        print (&quot;a cylinder&quot;)
        return {'FINISHED'}          
   
classes = (
    CheckShape,
    DrawCube,
    DrawCylinder)


def register():
    for cls in classes:
        bpy.utils.register_class(cls)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)

if __name__ == &quot;__main__&quot;:
    register()

So, if I draw a cube with the operator bpy.ops.myops.draw_cube(), I would like to be able to run other methods in the same class when I select the cube.  For instance, I would like the operator bpy.ops.myops.check_shape() to call the method in the appropriate class depending on the selected object.  When my myops.check_shape() operator is called, I get the following error message:
AttributeError: 'Object' object has no attribute 'check_shape'
Is it possible to fix my example so that it would work?
Also, is there an update function of some sort that will be run if the cube created with the custom operator is transformed?
Thanks.
I am trying to write a Python code to save a 3-d model created in Blender so that a simulation program can read it.  In order to save the data from the different types of objects, I have a list of if statements.  I was thinking I can avoid that if I could take advantage of the fact that Python is an object-oriented language and each object could have its own method to save data.
After reading the following question and answer,
Is it possible to create an own object data type through Python?
I think that the answer to my question is no, that will not work.  I may try to use a custom property to store the information I need for each object when I create it.  Then I could just get the value of the custom property instead of having a bunch of if statements.
I think custom properties have an update function, so that if the object is modified, I could catch that in my Python code and adjust the custom property.  Since I am only creating 3d models and not using other aspects of Blender, hopefully a custom property would not cause problems with memory use and execution time in Blender.