First of all, I am a total beginner in terms of Blender API. I have been working with Python and the Blender API for about 3 days now.
I already found out how to hide unwanted objects. Here is my code:
bpy.ops.object.select_pattern(pattern="*Collision")
original_type = bpy.context.area.type
bpy.context.area.type = "VIEW_3D"
bpy.ops.object.hide_view_set(unselected=False)
bpy.context.area.type = original_type
My goal here is to implement a checkbox so that when it's checked it will execute the code above. If it's unchecked it will reverse the code.
Can anybody help me?