#
# Copyright © 2020 MSC.Software Corporation
#  
# Permission to use Scripts
#  
# Permission is granted to MSC.Software customers with valid licenses of the MSC Apex™ software 
# to use script files posted on this page (collectively “Scripts”) solely for customers’ own authorized 
# internal use in conjunction with licensed use of the MSC Apex software.  
# No other use is permitted.  No license to MSC Apex or other software is granted under this Permission.
#  
# SCRIPTS ARE PROVIDED ON AN "AS-IS" BASIS, WITH NO WARRANTIES OF ANY KIND.  USE OF THE SCRIPTS IS AT CUSTOMER'S SOLE RISK.
#  
# IN NO EVENT SHALL MSC.SOFTWARE CORPORATION, ITS AFFILIATES, SUBSIDIARIES, SUPPLIERS, AGENTS, REPRESENTATIVES OR EMPLOYEES BE LIABLE FOR ANY 
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, 
# STRICT LIABILITY, OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION USE OF THE SCRIPTS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
#  
# Customer shall indemnify, defend and hold MSC.Software Corporation, its affiliates, subsidiaries, suppliers, agents, 
# employees or representatives (collectively, “Indemnified Parties”) harmless from and against any third-party claims 
# brought against Indemnified Parties rising out of or in connection with Customer’s use of the Scripts.
#
# MSC Apex - User Defined Tools using Python Scripts
# Check Box script to be called by Check Box UI Example
# 
def read_check_boxes(dict={}):

    import apex

    # Uncomment to disable display of script execution output dialog when script exits
#    apex.disableShowOutput()
    
    # Retrieve the active radio buttons from the dictionary
    # Check Box 1
    check_box_1_checked = "not checked"
    if dict["check_box_1"] is "True":
        check_box_1_checked = "checked"
    
    # Check Box 2
    check_box_2_checked = "not checked"
    if dict["check_box_2"] is "True":
        check_box_2_checked = "checked"

    # Check Box 3
    check_box_3_checked = "not checked"
    if dict["check_box_3"] is "True":
        check_box_3_checked = "checked"
                  
    # Print Check Box Results
    print("Check box 1 is ", check_box_1_checked)
    print("Check box 2 is ", check_box_2_checked)
    print("Check box 3 is ", check_box_3_checked)
