## bolt_match.py Version 1.01

## Copyright (c) 2007 Bruce Vaughan, BV Detailing & Design, Inc.

## All rights reserved.

## NOT FOR SALE. The software is provided "as is" without any warranty.

######################################################################

'''

Add bolts by matching material

 

Version 1.01 (11/2/07) - Add functions hole_match() and hole_bolt_match()

'''

from param import Warning

from bolt_add import Bolt

from hole_add import Hole

'''

print Bolt.__doc__

print dir(Bolt)

a = Bolt()

print dir(a)

import param

print param.__doc__

print dir(param)

print param.ResponseNotOK.__doc__

print param.Dialog.__doc__

print dir(param.Dialog)

a = param.Dialog('Test')

print dir(a)

from rolled_section import RolledSection

a = RolledSection()

print dir(a)

'''

 

def bolt_match(m, m_list_match):

    try:

        # bolt add begin

        bolt1 = Bolt()

        # bolt the first object in the mtrl list ([mtrl1, ])

        bolt1.mtrl = [m, ]

        # mem.main_mtrl() should be in match list

        # can be multiple mtrl objects

        bolt1.match = m_list_match

        bolt1.show_window = "No"

        bolt1.direction = "In"

        bolt1.add_match()

        # bolt add end

    except:

        Warning('Bolt match was unsuccessful.')

 

def hole_match(m, hl):

    try:

        # hole group add begin

        hole9 = Hole()

        hole9.mtrl = [m,]

        hole9.holes = [hl,]

        hole9.hole_type = "Standard Round"

        hole9.valid_cnc = "Yes"

        hole9.hole_dia = hole9.calc_hole_size()

        hole9.show_window = "No"

        hole9.create()

        # hole group add end

    except:

        Warning('Hole/Bolt match was unsuccessful.')

 

def hole_bolt_match(m, hl, m_list_match):

    try:

        # hole group add begin

        hole9 = Hole()

        hole9.mtrl = [m,]

        hole9.holes = [hl,]

        hole9.hole_type = "Standard Round"

        hole9.valid_cnc = "Yes"

        hole9.hole_dia = hole9.calc_hole_size()

        hole9.show_window = "No"

        hole9.create()

        # hole group add end

        # bolt add begin

        bolt1 = Bolt()

        bolt1.mtrl = [m,]

        bolt1.match = m_list_match

        bolt1.show_window = "No"

        bolt1.direction = "In"

        bolt1.add_match()

        # bolt add end

    except:

        Warning('Hole/Bolt match was unsuccessful.')