Skip to content

Instantly share code, notes, and snippets.

@khoitsma
Created August 19, 2022 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khoitsma/26746956e94aa27f956d1b11047080e9 to your computer and use it in GitHub Desktop.
Save khoitsma/26746956e94aa27f956d1b11047080e9 to your computer and use it in GitHub Desktop.
Per AISC 15th Edition, determine required setback dimensions for bolt holes
def determine_lc_edge_gage_reqd(diameter_label, class_hole):
"""
***************************
diameter_label: for example 'H0750' for 3/4 inch diameter bolt
class_hole: one of these ['STD', 'OVS', 'SSLT', 'LSLT'] standard, oversize, short slot, long slot
***************************
"""
if class_hole not in ['STD', 'OVS', 'SSLT', 'LSLT']:
return [["invalid hole class: " + class_hole]]
global dbaischole15 # db aisc hole
# dbaischole15 = V1415S.getallHolesAISC15() entire 'database'
# of hole dimensions
debug = False
dhole = dbaischole15[diameter_label.upper()] # 'database' row for given diameter_label
dbolt = dhole.DIAMETER # bolt diameter for given diameter_label
# define 'func_C2' which calculates 'C2' values in AISC Table J3.5
def func_C2(db, class_hole):
'''
db: bolt diameter
class_hole: one of these ['STD', 'OVS', 'SSLT', 'LSLT']
'''
if db <= 0.875:
if class_hole == "STD":
return 0
elif class_hole == "OVS":
return 0.0625
elif class_hole == "SSLT":
return 0.125
elif class_hole == "LSLT":
return 0.75*db
elif db == 1:
if class_hole == "STD":
return 0
elif class_hole == "OVS":
return 0.125
elif class_hole == "SSLT":
return 0.125
elif class_hole == "LSLT":
return 0.75 * db
else:
if class_hole == "STD":
return 0
elif class_hole == "OVS":
return 0.125
elif class_hole == "SSLT":
return 0.1875
elif class_hole == "LSLT":
return 0.75*db
# AISC limits
c2c_clr_limit = dbolt # AISC limit -- clear distance between holes
c2c_gage_limit = 2.6666 * dbolt # AISC limit -- center to center of holes
c2e_limit = dhole.MIN_EDGE # AISC limit -- center of hole to edge of plate
# AISC C2 calculation
c2 = func_C2(dbolt, class_hole)
CCWidth = CCLength = CEWidth = CELength = 0 # initialization of return variables
# AISC slots have a width and a length
# CCWidth = center to center 'width' direction
# CCLength = center to center 'length' direction
# CEWidth = center to edge 'width' direction
# CELength = center to edge 'length' direction
try:
if class_hole == "STD":
c2c_clr_gage_min = c2c_clr_limit + dhole.STD # clear limit + hole diameter
c2c_gage_min = max(c2c_clr_gage_min, c2c_gage_limit) # determine our minimum gage
CCWidth = c2c_gage_min
CCLength = c2c_gage_min
CEWidth = c2e_limit
CELength = c2e_limit
elif class_hole == "OVS":
c2c_clr_gage_min_W = c2c_clr_limit + dhole.OVS # clear limit + hole diameter
c2c_clr_gage_min_L = c2c_clr_limit + dhole.OVS # clear limit + hole diameter
c2c_gage_min_W = max(c2c_clr_gage_min_W, c2c_gage_limit) # determine our minimum gage
c2c_gage_min_L = max(c2c_clr_gage_min_L, c2c_gage_limit) # determine our minimum gage
CCWidth = c2c_gage_min_W
CCLength = c2c_gage_min_L
CEWidth = c2e_limit + c2
CELength = c2e_limit + c2
elif class_hole == "SSLT":
c2c_clr_gage_min_W = c2c_clr_limit + dhole.STD # clear limit + slot width
c2c_clr_gage_min_L = c2c_clr_limit + dhole.SSLOT # clear limit + slot length
c2c_gage_min_W = max(c2c_clr_gage_min_W, c2c_gage_limit)
c2c_gage_min_L = max(c2c_clr_gage_min_L, c2c_gage_limit)
CCWidth = c2c_gage_min_W
CCLength = c2c_gage_min_L
CEWidth = c2e_limit
CELength = c2e_limit + c2
elif class_hole == "LSLT":
c2c_clr_gage_min_W = c2c_clr_limit + dhole.STD
c2c_clr_gage_min_L = c2c_clr_limit + dhole.LSLOT
c2c_gage_min_W = max(c2c_clr_gage_min_W, c2c_gage_limit)
c2c_gage_min_L = max(c2c_clr_gage_min_L, c2c_gage_limit)
CCWidth = c2c_gage_min_W
CCLength = c2c_gage_min_L
CEWidth = c2e_limit
CELength = c2e_limit + c2
except:
pass
if CCWidth == 0:
return [["invalid result"]]
else:
ndigits = 2
return round(CCWidth, ndigits), round(CCLength, ndigits), round(CEWidth, ndigits), round(CELength, ndigits)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment