Show Sidebar / 3D-Print-Toolbox with Python API

Hey guys,

at the end of my python script, I’d like to show the 3D-Print-Toolbox in the sidebar (the one you can toggle with ‘N’ key).
I can already programmatically start the 3D-Print-Toolbox-Scan, but the sidebar still is invisible and has to be toggled manually.
Is there a way in scripting this?

Thank you
Ed

This is it.

>>> bpy.ops.preferences.addon_enable(module="object_print3d_utils")
{'FINISHED'}

>>> bpy.ops.preferences.addon_disable(module="object_print3d_utils")
{'FINISHED'}

Thanks for the hint, but it’s not exactly what I’ve been looking for.
The code you provided is for enabling / disabling the addon.

What I want to do is: Make the sidebar visible (the same what happens, when pressing the n-key)

Thanks anyways :slight_smile:

I found this one from the keyboard shortcuts window.

import bpy

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    def execute(self, context):
        context.space_data.show_region_ui ^= True # show_region_ui = !show_region_ui
        return {'FINISHED'}

def register():
    bpy.utils.register_class(SimpleOperator)

def unregister():
    bpy.utils.unregister_class(SimpleOperator)

if __name__ == "__main__":
    try:unregister()
    except:pass
    register()

Thanks mate!