##  Beam_OutriggerShape version 1.03

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

##  All rights reserved.

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

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

"""

    Add rolled shape outriggers (WF, angle, channel, WT, etc.) to a beam for support

    of edge material, hangers, etc. by picking points along the beam.

    The x or y values of the picked points must be along the beam work line.

    Outriggers can be added normal or vertical.

    The default cope length is the beam "A" dimension + 0.53125, rounded off to the

    nearest 1/4".

    The default cope depth is the beam "K" dimension + 0.047 + vert_offset, rounded

    off to the nearest 1/8".

 

    This script can be executed in plan or elevation.

 

    This source is provided "as is".  All warranties are disclaimed.

    Developed in SDS2 6.325, Python 2.2.1    3/1/04 (R1)

 

    V7R1 -          Test in SDS/2 7.002, update code (8/17/04)

                    Copes dimensions are calculated based upon user selections and

                    minimum cope dimensions - see Defaults section

    R2 -            Fixed a problem checking material grades

    R3 -            Add ClearSelection() (2/16/06)

    R4 (5/9/06) -   Import/Save defaults from/to disk

                    Add toe in/toe out option for angles and channels

    ******************************************************

    Version 1.01 -              Drop support for SDS/2 6.3

                                Consolidate dialog box

                                Add tabs and group titles to dialog box

    Version 1.02 -              Read and write defaults to macro/Defaults

                                Read image from macro/Images

    Version 1.03 (11/8/07) -    Update code

                                Add option for tight fit cut to beam flange

                                Renamed from Beam_RolledShapeOutrigger to Beam_OutriggerShape

 

    Developed by Bruce Vaughan, BV Detailing & Design, Inc. (615) 646-9239

    For comments, suggestions or questions call BVD at the number above.

 

    Go to defaults section to modify script defaults.

"""

# startup code begin

 

import os

from macrolib.FileDefaults import import_data, export_data

from macrolib.MemSelection import mem_select

from macrolib.Weld import mtrl_weld

from macrolib.angle import rtod, dtor

from macrolib.round_length import round_length_next, round_length_near

 

from param import *

from math import *

Units("feet")

 

from shape import Shape

from point import Point, PointLocate

from member import Member, MemberLocate

from mtrl_list import MtrlLocate, HoleLocate

from rect_plate import RectPlate

from rolled_section import RolledSection

from weld_add import Weld

from hole_add import Hole

from bolt_add import Bolt

from mtrl_fit import MtrlFit

from job import Job

from fab import Fabricator

from mtrl_cut import MtrlCut

from job import JobName

from fab import FabricatorName

 

def run_script():

    # startup code end

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

    ## Variables section

    # system path for defaults file

    default_file_path = os.path.join(os.getcwd(), "macro", "Defaults")

    # defaults file

    def_file = "Beam_OutriggerShape_v1_03.txt"

    image_path = os.path.join(os.getcwd(), "macro", "Images")

    image_name = os.path.join(image_path, "Beam_OutrigRS_Points.gif")

    image_name1 = os.path.join(image_path, "Beam_OutriggerShape1.gif")

       

    ###### default_file_path = "C:/ParamDef/Beam_RolledShapeOutrigger/"         # system path for defaults file

    ###### def_file = "Beam_RolledShapeOutrigger.txt"                          # defaults file

 

    script_name = "Beam_OutriggerShape_v1.03.py"

    # enable or disable the importing and exporting of dialog dictionary variables

    # ["Enable", "Disable"]

    enable_default_import_export = "Enable"

    finishList = ["Red Oxide", "Yellow Zinc", "Gray Oxide", "Sandblasted", "Blued Steel", "Galvanized", "None"]

    gradeList = ["A992", "A36", "A572-50", "A500-B", "A53", "A501"]

    holeTypeList = ["Standard Round", "Short Slot", "Oversized Round", "Long Slot"]

    weldTypeList = ["Fillet", "Bevel groove", "Square butt"]

    weldSizeList = ["3/16", "1/4", "5/16"]

    fitList = ("Tight Cut", "Fit", "Clear", "Min", "None")

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

    ## Defaults section

    # ["BS", "NS", "FS"]

    which_side = "NS"

    # outriggers are normal to beam or vertical ["Normal", "Vertical"]

    oriented = "Normal"

    # outrigger material size

    matl_size = "L4x4x1/4"

    # ("In", Out")

    toe_direction = "Out"

    # length of outrigger from beam CL

    matl_length = 12.0

    # vertical offset of plate (- is down, + is up)

    vert_offset = 0.0

    # default material color - finishList

    mtrl_finish = "Gray Oxide"

   

    # Default material grades:

    # Example: Job().steel_grades("Angle").keys()

    steelgradeA = "A36"                    

    steelgradeWF = "A992"

    steelgradeWT = "A992"

    steelgradeC = "A36"

    steelgradeHSS = "A500B"

    steelgradeP = Job().steel_grades("Pipe").keys()[0]

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

    ## HOLE PATTERN VARIABLES

    # add a hole pattern "Yes" "No"

    add_hole = "Yes"

    # horizontal distance from CL of beam

    x_ga = 11.5

    # vertical distance from top of outrigger material

    y_ga = 3.0

    # number of rows (Y direction of rolled shape)

    no_rows = 1

    # number of columns (X direction of rolled shape)

    no_cols = 2

    # hole row spacing

    row_spa = 4.0

    # hole column spacing

    col_spa = 3.0

    # bolt size

    bolt_size = 0.75

    # bolt type Job().bolt_sched()

    bolt_type = "A325N"

    # hole type holeTypeList

    hole_type = "Long Slot"

    slot_length = 1.5

    slot_dir = 90.0

    # add weld 'Yes', 'No'

    add_weld = "Yes"

    # type of weld

    weld_type = "Fillet"

    # weld size

    weld_size = "3/16"

    # weld tail text

    tail_text = "NONE"

    # minimum cope dimensions - min_cope_length will be overriden if fit_flg_to_toe = "Yes" 

    min_cope_length = 1.0

    min_cope_depth = 1.0

    # type of outrigger cope

    # "Tight Cut" - Use cut layout to fit closely to the supporting beam flange

    # "Fit" - Abut the supporting member flange toe

    # "Min" - Use the script minimum

    # fitList

    fit_flg_to_toe = "Fit"

 

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

    ## Function definition section ############################

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

    # Function to add a rolled shape

    # reference points are the end work points of the material

    # returns a rolled shape object

    def outrig_rs(mem, pnt1, pnt2, matl_size, cope_top, cope_bot, matl_length, grade, mtrl_finish, rotpl, bm_slope, left_setback, toe):

        rot_arg = (rotpl[0], rotpl[1], (rotpl[2] - bm_slope))

        if cope_top:

            leftt_op = "Cope plain"

            leftt_len, leftt_dep = cope_top

        else:

            leftt_op = "None"

            leftt_len = 0.0

            leftt_dep = 0.0

        if cope_bot:

            leftb_op = "Cope plain"

            leftb_len, leftb_dep = cope_bot

        else:

            leftb_op = "None"

            leftb_len = 0.0

            leftb_dep = 0.0

        matl_type = Shape(matl_size).type()

        # rolled section begin

        rl1 = RolledSection()

        rl1.member = mem

        rl1.pt1 = pnt1

        rl1.pt2 = pnt2

        rl1.section_size = matl_size

        rl1.grade = grade

        rl1.centered = "No"

        rl1.top_oper_left = leftt_op

        rl1.top_length_left = leftt_len

        rl1.top_cope_left = leftt_dep   

        rl1.top_oper_right = "None"

        rl1.bottom_oper_left = leftb_op

        rl1.bottom_length_left = leftb_len

        rl1.bottom_cope_left = leftb_dep

        rl1.bottom_oper_right = "None"

        rl1.llv = "HZ."

        rl1.toe_io = toe

        rl1.rolling_op = "None"

        rl1.width = 0

        rl1.thick = 0

        rl1.field_weld_prep_left = "No"

        rl1.field_weld_prep_right = "No"

        rl1.cut_radius_left = 0.5

        rl1.cut_radius_right = 0.5

        rl1.web_setback_left = 0

        rl1.web_setback_right = 0

        rl1.angle_of_twist = 0

        rl1.mid_ordinate = 0

        rl1.bend_angle = 0

        rl1.bend_radius = 0

        rl1.rolled_offset = 0

        rl1.work_pt_dist = matl_length

        rl1.setback_left = left_setback

        rl1.setback_right = 0

        rl1.web_cut_angle_left = 0

        rl1.web_cut_angle_right = 0

        rl1.flange_cut_left = 0

        rl1.flange_cut_right = 0

        rl1.end_cut_left = "Standard Cut"

        rl1.end_cut_right = "Standard Cut"

        rl1.length = rl1.work_pt_dist - rl1.setback_left - rl1.setback_right

        rl1.mtrl_type = matl_type

        rl1.finish = mtrl_finish

        rl1.ref_pt_offset = (0.000000, 0.000000, 0.000000)

        rl1.add()

        rl1.rotate(rl1.member, rot_arg)

        # rolled section end

        return rl1

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

    # Function to add weld

    def shape_weld(bm, rl5, weld_size, weld_type, text):

        if weld_type == "Fillet":

            allow_fillet = "Yes"

            allow_bevel = "No"

            allow_square = "No"

        elif weld_type == "Bevel groove":

            allow_fillet = "No"

            allow_bevel = "Yes"

            allow_square = "No"

        else:

            allow_fillet = "No"

            allow_bevel = "No"

            allow_square = "Yes"

        try:

            # weld add begin

            weld9 = Weld()

            weld9.mtrl =  [rl5, ]

            weld9.weld_to = [bm, ]

            weld9.min_size = weld_size

            weld9.max_size = 1

            weld9.min_length = 1

            weld9.max_gap = 0.25

            weld9.stagger_length = 3

            weld9.stagger_spacing = 12

            weld9.holdback_length = 0

            weld9.root_face = 0

            weld9.root_opening = 0

            weld9.b_groove_angle = 45

            weld9.v_groove_angle = 60

            weld9.all_around = "No"

            weld9.stagger = "No"

            weld9.inside = "No"

            weld9.auto_size = 0

            weld9.full_penetration = "No"

            weld9.fillet_back = "No"

            weld9.holdback_end = 0

            weld9.prequalified = "No"

            weld9.backing_bar = 0

            weld9.spacer = 0

            weld9.contour = "None"

            weld9.allow_fillet = allow_fillet

            weld9.allow_square = allow_square

            weld9.allow_bevel = allow_bevel

            weld9.allow_v = "No"

            weld9.allow_j = "No"

            weld9.allow_u = "No"

            weld9.allow_flare_bevel = "No"

            weld9.allow_flare_v = "No"

            weld9.allow_plug = "No"

            weld9.allow_backing = "No"

            if text == "NONE":

                weld9.tail_text = ""

            else:

                weld9.tail_text = text

            weld9.show_window = "No"

            weld9.create()

            # weld add end

        except: pass

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

    # Function to add a hole pattern

    def shape_hole (rl9, pnt1, ed, ga, no_rows, no_cols, row_spa, col_spa, hltype, fa, bltype, bs, slot_len, dir):

        if slot_len:

            str = "slot_len"

        else:       

            str = "hole26.calc_slot_length()"

        try:

            # hole group add begin

            hole26 = Hole()

            hole26.mtrl = [rl9, ]

            hole26.pt1 = pnt1

            hole26.hole_type = hltype

            hole26.face = fa

            hole26.valid_cnc = "Yes"

            hole26.x_ref_offset = ed

            hole26.y_ref_offset = ga

            hole26.x_spa = col_spa

            hole26.y_spa = row_spa

            hole26.group_rot = 0.0

            hole26.locate = "Below Left"

            hole26.columns = no_cols

            hole26.rows = no_rows

            hole26.bolt_type = bltype

            hole26.bolt_dia = bs

            hole26.slot_rot = dir

            hole26.length = eval(str)

            hole26.hole_dia = hole26.calc_hole_size()

            hole26.show_window = "Yes"

            hole26.create()

        except: pass

    # hole group add end

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

    # Function to return a point along the member line given member object and user selected point.

    # User selected point must be correct x and y values on member line, or calculated point will not be correct.

    def ret_pt_WP (mem, pnt2):

        pnt1 = mem.left_location

        dist_h = Point(pnt1.x, pnt1.y, 0.0).dist(Point(pnt2.x, pnt2.y, 0.0))

        ang_1 = mem.plan_rotation

        if (pnt2.x - pnt1.x) == 0.0:

            ang_2 = 90.0

        else:

            ang_2 = rtod(atan((pnt2.y - pnt1.y) / (pnt2.x - pnt1.x)))

        ang_net = ang_1 - ang_2

        dist_b = abs((dist_h * cos(dtor(ang_net))) / cos(dtor(mem.slope)))   

        return pnt1 + mem.translate(dist_b, 0.0, 0.0)

    # end function definition

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

    def cut_points(ptWP, mtrl, cut_depth, cut_length, clip_dim, vert_offset):

        '''

        ptWP is a point at the CL of the beam

        The cut is made at the material left end.

        Adjust point locations for left end setback.

        '''

        pt1 = mtrl.pt1 + mtrl.translate(mtrl.setback_left, 0.0, 0.0)

        ptList = [ptWP,]

        ptList.append(ptWP + mtrl.translate(0.0, -cut_depth-clip_dim, 0.0))

        ptList.append(pt1 + mtrl.translate(0.0, -cut_depth-clip_dim-vert_offset, 0.0))

        ptList.append(pt1 + mtrl.translate(clip_dim, -cut_depth-vert_offset, 0.0))

        ptList.append(pt1 + mtrl.translate(cut_length, -cut_depth-vert_offset, 0.0))

        ptList.append(pt1 + mtrl.translate(cut_length, (cut_depth+vert_offset)*10, 0.0))

        ptList.append(ptWP + mtrl.translate(0.0, (cut_depth+vert_offset)*10, 0.0))

        ptList.append(ptWP)

        return ptList

 

    def mtrlCut(mtrl, ptList):

        try:

            # mtrl cut begin

            mcut1 = MtrlCut()

            mcut1.mtrl = [mtrl, ]

            mcut1.rotate = (0,0,0)

            for pt in ptList:

                mcut1.pts.append((pt, 0.0))

            mcut1.cut("Layout")

            # mtrl cut end

            return True

        except:

            Warning(formatExceptionInfo())

            return False

 

    ## End function definitions

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

    ## Import defaults data if enabled

    if enable_default_import_export == "Enable":

        dd0 = import_data(os.path.join(default_file_path, def_file))

        if dd0:

            for key, value in dd0.items():

                exec "%s = %s" % (key, repr(value)) in None

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

    ## MAIN PROGRAM LOOP

    while True:

        ClearSelection()

        # Select member to receive outriggers

        bm_list = mem_select("Select WF or HSS BEAM Member to Add Rolled Shape Outriggers", ['Beam',], ['W flange', 'Tube'])

        mem1 = bm_list[0]

 

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

        ## DIALOG BOX 1 --------------------------------------------#

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

        dlg1 = Dialog( "Add rolled shape outriggers to beams")

        dlg1.menu("print_doc", ("Yes", "No"), "No", "Print documentation only")

       

        dlg1.tabset_begin()

 

        dlg1.tab("General Information")

        dlg1.line("Beam plan length = " + dim_print(mem1.plan_length) + "   Beam Size = " + mem1.size +\

                  "   Beam slope length = " + dim_print(mem1.input_length))

        dlg1.label(dim_print(mem1.tf), "Beam flange thickness:                                  ")

        dlg1.group_title("General")

        dlg1.menu("which_side", ("BS", "NS", "FS"), which_side, "Which side(s) of beam web?" )

        dlg1.menu("oriented", ("Normal", "Vertical"), oriented, "Rolled shape orientation")

        dlg1.group_title_end

 

        dlg1.group_title("Outrigger material")

        dlg1.entry("matl_size", matl_size, "Outrigger material size                     " )

        dlg1.menu("toe_direction", ("In", "Out"), toe_direction, "Material toe direction where applicable")

        dlg1.menu("mtrl_finish", finishList, mtrl_finish, "Material finish")

        # dlg1.menu("steelgrade", gradeList, steelgrade, "Material grade" )

        dlg1.group_title_end

 

        dlg1.group_title("Dimension and cope options")

        dlg1.entry("matl_length", dim_print(matl_length), "Outrigger length from beam CL" )

        dlg1.entry("vert_offset", dim_print(vert_offset), "Vertical offset (- down, + up)" )

        dlg1.menu("fit_flg_to_toe", ("Tight Cut", "Fit", "Clear", "Min", "None"), fit_flg_to_toe, "Outrigger cope length options")

        dlg1.group_title_end

 

        dlg1.tab("Material Grade")   

        dlg1.group_title("Material grade")

        dlg1.menu("steelgradeA", Job().steel_grades("Angle").keys(), steelgradeA, "Material grade for 'Angle' material")

        dlg1.menu("steelgradeWF", Job().steel_grades("WFlange").keys(), steelgradeWF, "Material grade for 'W flange' material")

        dlg1.menu("steelgradeWT", Job().steel_grades("Tee").keys(), steelgradeWT, "Material grade for 'W Tee' material")

        dlg1.menu("steelgradeC", Job().steel_grades("Channel").keys(), steelgradeC, "Material grade for 'Channel' material")

        dlg1.menu("steelgradeHSS", Job().steel_grades("Tube").keys(), steelgradeHSS, "Material grade for 'Tube' material")

        dlg1.menu("steelgradeP", Job().steel_grades("Pipe").keys(), steelgradeP, "Material grade for 'Pipe' material")

        dlg1.group_title_end   

 

        dlg1.tab("Hole Information")

        dlg1.menu("add_hole", ("Yes", "No"), add_hole, "Add a hole pattern in the web             ")

        dlg1.group_title("Dimensions")

        dlg1.entry("x_ga", dim_print(x_ga), "Horizontal distance from beam CL to farthest hole")

        dlg1.entry("y_ga", dim_print(y_ga), "Vertical distance from top of outrigger to first hole")

        dlg1.entry("no_cols", no_cols, "Number of hole columns (X dir. of material)")

        dlg1.entry("no_rows", no_rows, "Number of hole rows (Y dir. of material)")

        dlg1.entry("col_spa", dim_print(col_spa), "Hole column spacing (X dir. of material)")

        dlg1.entry("row_spa", dim_print(row_spa), "Hole row spacing (Y dir. of material)")

        dlg1.group_title_end

        dlg1.group_title("Bolt and Hole Information")

        dlg1.entry("bolt_size", dim_print(bolt_size), "Enter bolt size")

        dlg1.menu("hole_type", holeTypeList, hole_type, "Hole type in plate")

        dlg1.menu("bolt_type", Job().bolt_sched(), bolt_type, "Bolt type in outrigger web")

        dlg1.group_title_end

        dlg1.group_title("Options for 'Long Slot'")

        dlg1.entry("slot_length", dim_print(slot_length), "Enter long slot length")

        dlg1.entry("slot_dir", slot_dir, "Enter slot direction")

        dlg1.group_title_end

 

        dlg1.tab("Weld Information")

        dlg1.group_title("Weld")

        dlg1.menu("add_weld", ("Yes", "No"), add_weld, "Add weld to outrigger                         " )

        dlg1.menu("weld_type", ("Fillet", "Square butt", "Bevel groove"), weld_type, "Weld type" )

        dlg1.menu("weld_size", ("3/16", "1/4", "5/16"), dim_print(weld_size), "Weld size")

        dlg1.menu("tail_text", ("TYP", "NONE"), tail_text, "Tail text for weld")

        dlg1.group_title_end

 

        dlg1.tab("Graphic Info")

        dlg1.image(image_name)

        dlg1.tab("Images")

        dlg1.group_title("Toed Out, NS, Tight Fit")

        dlg1.image(image_name1)

        dlg1.group_title_end

 

        try:

            dd1 = dlg1.done()

        except ResponseNotOK:

            break

 

        # When fraction is selected from menu in dialog box, 'str' type is retained.

        # Convert 'str' to 'float' using 'param.dim'

        dd1["weld_size"] = dim(dd1["weld_size"])

       

        # Update the local namespace

        for key, value in dd1.items():

            exec "%s = %s" % (key, repr(value)) in None

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

        ## END DIALOG BOX 1 ------------------------------------------#

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

 

        # Export defaults to disk if enabled

        if enable_default_import_export == "Enable":

            export_data(os.path.join(default_file_path, def_file), dd1, script_name)       

       

        if print_doc == "Yes":

            print __doc__

            break

       

        ## Set material grade

        try:

            if Shape(matl_size).type() == "Angle":

                steelgrade = steelgradeA

            elif Shape(matl_size).type() == "W flange":

                steelgrade = steelgradeWF

            elif Shape(matl_size).type() == "W Tee":

                steelgrade = steelgradeWT

            elif Shape(matl_size).type() == "Channel":

                steelgrade = steelgradeC

            elif Shape(matl_size).type() == "Tube":

                steelgrade = steelgradeHSS

            elif Shape(matl_size).type() == "Pipe":

                steelgrade = steelgradeP

            else:

                Warning("The material type entered is not valid")

                break

        except:

            Warning("The material entered is invalid")

            break

           

        # calculate outrigger cope; set cope to 0.0 if material is "Tube" or fit_flg_to_toe == "None"

        if mem1.mtrl_type == "W flange":

            cut_depth = max((round((mem1.k + 0.046875 + dim(vert_offset)) * 8.0) / 8.0), min_cope_depth)

            if fit_flg_to_toe == "Fit":

                cut_length = (round(((mem1.bf - mem1.tw) / 2 + 0.03125) * 16.0) / 16.0)

            elif fit_flg_to_toe == "Clear":

                cut_length = max((round(((mem1.bf - mem1.tw) / 2 + 0.53125) * 4.0) / 4.0), min_cope_length)

            elif fit_flg_to_toe == "Min":

                cut_length = max((round((mem1.k - mem1.tf) * 8.0) / 8.0), min_cope_length)

            elif fit_flg_to_toe == "None":

                cut_length = 0.0

                cut_depth = 0.0

            elif fit_flg_to_toe == "Tight Cut":

                # round_length_next(length, increment="1/16")

                tight_cut_depth = round_length_next(mem1.tf)

                tight_cut_length = round_length_next((mem1.bf/2.0)-(mem1.tw/2.0), '1/8')

                clip_dim = round_length_near(mem1.k-tight_cut_depth+0.125, "1/4")

                cut_length = 0.0

                cut_depth = 0.0

            else:

                print "Invalid option"

                break

        else:

            cut_length = 0.0

            cut_depth = 0.0

           

        if cut_depth < 0.0:

            cut_depth = 0.0

 

        # check for minimum cope depth

        if Shape(matl_size).type() in ["W flange", "Channel", "Angle", "W Tee"]:

            if cut_depth != 0.0 and fit_flg_to_toe == "Tight Cut":

                cut_depth = max(Shape(matl_size).k, cut_depth)

           

        if oriented == "Vertical":

            sl = mem1.slope

        else:

            sl = 0.0

 

        if mem1.mtrl_type == "Tube":

            z_offset = mem1.shape().short_depth / 2

        else:

            z_offset = mem1.tw / 2.0

 

        if cut_length == 0.0 or cut_depth == 0.0:

            copetop = 0

            copebot = 0

        else:

            copetop = (cut_length, cut_depth)

            #print "Cope the top flange"

            if Shape(matl_size).depth - vert_offset > (mem1.depth - mem1.k + 0.1875):               # allow 3/16" encroachment

                copebot = (cut_length, max(min(cut_depth, Shape(matl_size).k), (Shape(matl_size).depth - vert_offset - mem1.depth + mem1.k)))

                #print "Cope the bottom flange"

                #print Shape(matl_size).depth, "-", vert_offset, -mem1.depth, "+", mem1.k, "=", (Shape(matl_size).depth - vert_offset - mem1.depth + mem1.k)

            else:

                copebot = 0

        # POINT SELECTIONS MUST BE MADE ALONG MEMBER ORIGINALLY SELECTED (mem1)

        pt_left = PointLocate ("Locate first outrigger")

        if not pt_left:

            break

        # calculate point location in member coordinates so application can be made to all like members

        pt_left_loc = mem1.trans_to_local(ret_pt_WP(mem1, pt_left) - mem1.left_location)

 

        while True:

            for beam_mem in bm_list:

                pt_WP = beam_mem.left_location + beam_mem.translate(pt_left_loc.x + sin(dtor(sl)) * vert_offset, \

                                                                    cos(dtor(sl)) * vert_offset, 0.0)

                if which_side == "NS" or which_side == "BS":

                    pt21 = pt_WP + beam_mem.translate(0.0, 0.0, 0.0)

                    pt22 = pt21 + beam_mem.translate(0.0, 0.0, matl_length)

                    rp11 = outrig_rs(beam_mem, pt21, pt22, matl_size, copetop, copebot, matl_length, \

                                     steelgrade, mtrl_finish, (0.0, 90.0, 0.0), sl, z_offset, toe_direction)

                    if add_weld == "Yes":

                        shape_weld(beam_mem, rp11, dim(weld_size), weld_type, tail_text)

                   

                    if add_hole == "Yes":

                        if (Shape(matl_size).type() == "Angle" or Shape(matl_size).type() == "Channel"):

                            if toe_direction == "In":

                                hlface = "Web NS"

                            else:

                                hlface = "Web FS"

                        else:

                            hlface = "Web NS"

                        shape_hole(rp11, pt22, matl_length - x_ga, y_ga, no_rows, no_cols, row_spa, col_spa,\

                                hole_type, hlface, bolt_type, bolt_size, slot_length, slot_dir)

 

                    if fit_flg_to_toe == "Tight Cut":

                        mtrlCut(rp11, cut_points(pt21, rp11, tight_cut_depth, tight_cut_length, clip_dim, vert_offset))

                   

                if which_side == "FS" or which_side == "BS":

                    pt31 = pt_WP + beam_mem.translate(0.0, 0.0, 0.0)

                    pt32 = pt31 + beam_mem.translate(0.0, 0.0, -matl_length)

                    rp12 = outrig_rs(beam_mem, pt31, pt32, matl_size, copetop, copebot, matl_length, \

                                     steelgrade, mtrl_finish, (0.0, -90.0, 0.0), sl, z_offset, toe_direction)

                    if add_weld == "Yes":

                        shape_weld(beam_mem, rp12, dim(weld_size), weld_type, tail_text)

                       

                    if add_hole == "Yes":

                        if (Shape(matl_size).type() == "Angle" or Shape(matl_size).type() == "Channel"):

                            if toe_direction == "In":

                                hlface = "Web NS"

                            else:

                                hlface = "Web FS"

                        else:

                            hlface = "Web NS"

                        shape_hole(rp12, pt32, matl_length - x_ga, y_ga, no_rows, no_cols, row_spa, col_spa,\

                                hole_type, hlface, bolt_type, bolt_size, slot_length, slot_dir)

                       

                    if fit_flg_to_toe == "Tight Cut":

                        mtrlCut(rp12, cut_points(pt31, rp12, tight_cut_depth, tight_cut_length, clip_dim, vert_offset))

 

            pt_left = PointLocate ("Pick another outrigger location")

            if pt_left == None:

                break

            pt_left_loc = mem1.trans_to_local(ret_pt_WP(mem1, pt_left) - mem1.left_location)

               

        if not yes_or_no("Add rolled shape outriggers to another beam?"):

            break

## End run_script()

if __name__ == '__main__':

    try:

        run_script()

    finally:

        ClearSelection()

        del run_script