Back to SDS/2 Parametric Scripts

# material properties

from mtrl_list import MtrlLocate

from point import Point, PointLocate

from shape import Shape

m1 = MtrlLocate("Select material", "Single")

try:

    d = Shape(m1.description).depth

    print 'Shape(m1.description) = %s' % (d)

except:

    pass

print

 

mtrl_att_list = ['pt1', 'pt2', 'section_size', 'description', 'grade', 'centered',\

                 'origin', 'top_oper_left', 'top_length_left', 'top_cope_left',\

                 'top_oper_right', 'top_length_right', 'top_cope_right', 'bottom_oper_left',\

                 'bottom_length_left', 'bottom_cope_left', 'bottom_oper_right',\

                 'bottom_oper_right', 'bottom_length_right', 'bottom_cope_right', 'llv',\

                 'toe_io', 'rolling_op', 'width', 'thick', 'field_weld_prep_left',\

                 'field_weld_prep_right', 'reent_hole_dist_left', 'reent_hole_dist_right',\

                 'cut_radius_left', 'cut_radius_right', 'top_clip_left', 'top_clip_right',\

                 'web_setback_left', 'web_setback_right', 'angle_of_twist', 'mid_ordinate',\

                 'bend_angle', 'bend_radius', 'rolled_offset', 'work_pt_dist', 'setback_left',\

                 'setback_right', 'web_cut_angle_left', 'web_cut_angle_right',\

                 'flange_cut_left', 'flange_cut_right', 'end_cut_left', 'end_cut_right',\

                 'length', 'mtrl_type', 'finish', 'ref_pt_offset', 'translate',\

                 'to_local', 'to_global', 'trans_to_local', 'trans_to_global', 'mtrl_usage',\

                 'depth', 'category_defs', 'piecemark', 'weight', 'main_mtrl', 'mtrl_is_main']

print "\nKnown material attributes and built-in methods:"

print 'm1', "=", m1

mtrl_att_list.sort()

mtrl_pt2 = m1.pt1 + m1.translate(m1.work_pt_dist, 0.0, 0.0)

for i in mtrl_att_list:

    try:

        eval('m1.' + i)

    except:

        if i == 'pt2':

            print "'m1.pt2' is not valid. Calculated pt2 =", mtrl_pt2

        else:

            print "'m1." + i + "' is not a valid attribute for this material."

    else:

        print 'm1.' + i + " =", eval('m1.' + i)

 

for item in dir(m1):

    print item

 

""" Sample Output

Known material attributes and built-in methods:

m1 = <gen_mtrl object at 0x06DD65A8>

m1.angle_of_twist = 0.0

m1.bend_angle = 0.0

m1.bend_radius = 0.0

m1.bottom_cope_left = 0.0

m1.bottom_cope_right = 1.375

m1.bottom_length_left = 0.0

m1.bottom_length_right = 2.75

m1.bottom_oper_left = None

m1.bottom_oper_right = Cope plain

m1.bottom_oper_right = Cope plain

'm1.category_defs' is not a valid attribute for this material.

m1.centered = No

m1.cut_radius_left = 0.5

m1.cut_radius_right = 0.5

'm1.depth' is not a valid attribute for this material.

m1.description = W14x34

m1.end_cut_left = Standard Cut

m1.end_cut_right = Standard Cut

m1.field_weld_prep_left = No

m1.field_weld_prep_right = No

m1.finish = Red oxide

m1.flange_cut_left = 0.0

m1.flange_cut_right = 0.0

m1.grade = A992

m1.length = 398.125

m1.llv = HZ.

m1.mid_ordinate = 0.0

m1.mtrl_type = W flange

m1.mtrl_usage =

m1.origin = FS

m1.piecemark = w32

m1.pt1 = 231, 356, 11806

'm1.pt2' is not valid. Calculated pt2 = 630.25, 356, 11806

m1.reent_hole_dist_left = 0.0

m1.reent_hole_dist_right = 0.0

m1.ref_pt_offset = 0, 0, 0

m1.rolled_offset = 0.0

m1.rolling_op = None

'm1.section_size' is not a valid attribute for this material.

m1.setback_left = 0.0

m1.setback_right = 1.125

m1.thick = 0.0

m1.to_global = <built-in method to_global of gen_mtrl object at 0x06DD65A8>

m1.to_local = <built-in method to_local of gen_mtrl object at 0x06DD65A8>

m1.toe_io = Out

m1.top_clip_left = 0.0

m1.top_clip_right = 1.375

m1.top_cope_left = 0.0

m1.top_cope_right = 1.375

m1.top_length_left = 0.0

m1.top_length_right = 2.75

m1.top_oper_left = None

m1.top_oper_right = Cope plain

m1.trans_to_global = <built-in method trans_to_global of gen_mtrl object at 0x06DD65A8>

m1.trans_to_local = <built-in method trans_to_local of gen_mtrl object at 0x06DD65A8>

m1.translate = <built-in method translate of gen_mtrl object at 0x06DD65A8>

m1.web_cut_angle_left = 0.0

m1.web_cut_angle_right = 0.0

m1.web_setback_left = 0.0

m1.web_setback_right = 0.0

m1.weight = 1128.02087402

m1.width = 13.98

m1.work_pt_dist = 399.25

"""