How to get operator object given id?

I’m writing a script that contains both an operator and a panel. Both the operator and the panel are created in the script’s register() method. In my panel’s draw() method, I’d like to be able to get a reference to the operator object so I can access its properties. Is there a way to look up the operator object using its ID?

1 Like

Hi man,
From the panel you can set the operator properties like this

row = layout.row()  #    ----------------------   New Row
op = row.operator("wm.custom_operator", icon='PLUS', text="add cube" )  
op.Namecustom =  "CoolCube"    

This custom operator have a Namecustom property to Create a cube and name it like this.

I dont know if once created you can read his id elsewhere,
That could be a cool thing to know