The MemberBase module

The MemberBase module is used for creating parametric code for custom members .

Here's an example in which MemberBase is used to find the attributes of a custom member. This is particularly effective when a concrete custom member is selected, and it may be useful for finding the attributes of other custom members.

SDS2 Python Prompt
# Reveals the attributes of a custom member that you select.
# In this example a concrete single tee is selected.
>>> import model
>>> import MemberBase
>>> m = model.selected_member()
>>> mem = MemberBase.GetMemberLink(int(m.MemberNumber), False, False)
>>> mem              # Prints the name of the member and a dictionary of attributes.
SingleTee({'_depth': 28.0, 'strength_index': 3, '_stem_flg_radius': 3.0, '_left_stem_to_edge': 30.0, '_version': 0, '_material_creation_phases': ([], [], [], []), '_stem_spacing': 0.0, '_flange_end_radius': 0.5, '_stem_chamfer': 0.5, '_stem_top': 8.0, '_right_stem_to_edge': 30.0, 'finish_index': 1, '_flange_thickness': 2.0, '_num_stems': 1, '_stem_bottom': 5.75})

To get help on MemberBase, use the built-in Python functions dir() and help() .

PR 33190 In parametrics, MemberBase.GetMemberLink throws an exception when passed an invalid member number.(v2015)

PR 37102 In custom member setup (Options->Job Setup->Plugin Defaults->Member), the registered class name is now displayed instead of the fully qualified class name.

This is made possible with the new ability to access the registered custom member names from Python. See help(MemberBase.RegisteredClassDescription) for more information. (v2015)

PR 11170 Any submaterial in the job can now be added parametrically using the sds2.sub_mtrl .SubMaterialReference.BuiltinMaterial conversion and the MemberBase.AddMaterial API. For example (v2016):

from sds2.sub_mtrl import SubMaterialReference
from MemberBase import GetMemberLink
from Transform3D import Transform3D
member_number = 1
sub_mtrl_idx = 1
mem = GetMemberLink(member_number, False, True)
mtrl = SubMaterialReference(sub_mtrl_idx).BuiltinMaterial()
mtrl.SetXform(Transform3D(member_number))
mem.AddMaterial(mtrl)
mem.Write()