SDS2 Parametric API
 All Classes Namespaces Functions Variables Pages
Functions
sds2.iterators Namespace Reference

iterators for job objects More...

Functions

def all_bs
def all_cs
def all_es
def all_hs
def all_les
def all_mns
def all_mts
def all_pycs
def all_pyms
def all_res
def all_vs
def all_ws
def beams
def bolts
def bs
def bs_created_by_creator_uuid_bytes
def bs_created_by_member_end_tuple
def bs_on_mo_ms
def columns
def components
def components_of_class
def conn_components
def cs
def cs_on_mns
def custom_members
def custom_members_with_class_name
def custom_members_with_class_name_in_names
def ends
def es
def es_on_mo_ms
def filter_by_creator_uuid_bytes
def flattened_mts_bs_ws_on_mo_ms
def gen_materials
def gen_mts
def hbraces
def hlists
def hlists_m
def hlists_ms
def holes
def holes_m
def holes_mo_mts
def holes_ms
def hs
def iflatten
def iflatten2
def imap_constructor_to_unpackable_indices
def joists
def le_conn_components
def les
def linked_ms
def lua_modifies
def lua_ms
def materials
def mbs
def mns
def mns_from_mo_ms
def mns_from_mos
def mo_bs
def mo_es
def mo_hs
def mo_les
def mo_ms
def mo_mts
def mo_res
def mo_ws
def ms
def ms_intersecting_aabb
def ms_intersecting_aabb_c
def ms_intersecting_aabb_e
def ms_intersecting_aabb_m
def ms_intersecting_aabb_m_es
def ms_intersecting_aabb_origin
def ms_intersecting_aabb_pt
def ms_intersecting_aabb_pt_strip
def ms_intersecting_aabb_seg
def ms_intersecting_aabb_seg_strip
def ms_line_has_c
def ms_line_has_e
def ms_line_has_m_es
def ms_line_has_origin
def ms_line_has_pt
def ms_line_has_pt_strip
def ms_marked_for_process_or_solids
def ms_with_mem_link
def ms_with_memt
def ms_with_memt_in_memts
def mts
def mts_bs_ws_created_by_creator
def mts_bs_ws_created_by_end
def mts_bs_ws_on_mo_ms
def mts_created_by_creator_uuid_bytes
def mts_created_by_member_end_tuple
def mts_on_mo_ms
def mts_with_mtrl_type
def mts_with_mtrl_type_in_mtrl_types
def mts_with_use
def mts_with_use_in_uses
def pycomponents
def pycs_on_mn
def pycs_on_mns
def re_conn_components
def res
def to_mos
def unique_active_ms
def unique_everseen
def unique_hosts
def unique_hosts_from_mos
def unique_mns
def unique_mns_from_mos
def vbraces
def vs
def vs_on_ms
def welds
def ws
def ws_created_by_creator_uuid_bytes
def ws_created_by_member_end_tuple
def ws_on_mo_ms

Detailed Description

iterators for job objects

mo_ms([1,2]) -> obj.mo_m(1), obj.mo_m(2) mo_les([1,2]) -> obj.mo_le(1), obj.mo_le(2)

Notice the naming convention to append an 's' to function that creates a model.object, e.g. mo_m creates a member while mo_ms creates members

The naming convention for creating model.object iterators from generic types is to drop the leading 'mo_'. ms((1,member.Member(2))) -> obj.mo_m(1), obj.mo_m(2) mts((member.Member(1).Material(0), (1,1))) -> obj.mo_mt(1,0), obj.mo_mt(1,1)

This module defines useful iterators for chaining all the objects on multiple members. ends((1,2,3)) -> obj.mo_le(1), obj.mo_re(1), obj.mo_le(2), obj.mo_re(2), obj.mo_le(3), obj.mo_re(3) materials((1, 2)) -> all the materials on member 1 and member 2 gen_materials((1, 2)) -> all the gen_mtrls on member 1 and member 2 holes(materials([1])) -> all the holes on all the materials on member 1

Function Documentation

def sds2.iterators.all_bs (   args)
 All bolts in the job
 
 return bs_on_mo_ms(obj.all_ms())
def sds2.iterators.all_cs (   args)
 All components in the job
 
 return cs_on_mns(all_mns())
def sds2.iterators.all_es (   args)
 All ends in the job
 
 return es_on_mo_ms(obj.all_ms())
def sds2.iterators.all_hs (   args)
 All the holes in the job
 
 return holes_mo_mts(all_mts())
def sds2.iterators.all_les (   args)
 All left ends in the job
 
 return itertools.imap(obj.mo_le, all_mns())
def sds2.iterators.all_mns (   args)
 return mns_from_mo_ms(obj.all_ms())
 
 Example: assert [x.number for x in obj.all_ms()] == list(all_mns())
def sds2.iterators.all_mts (   args)
 All materials in the job
 
 return materials(obj.all_ms())
def sds2.iterators.all_pycs (   args)
 All python components in the job
 
 return ifilter(obj.is_pyc, all_cs())
 
 Example: assert [x.uuid for x in pycomponents(obj.all_ms())] == [x.uuid for x in all_pycs()]
def sds2.iterators.all_pyms (   args)
 All python members in the job
 
 return itertools.imap(obj.mb_from_mn, mns_from_mo_ms(filter(obj.is_mo_m_pym, obj.all_ms())))
 
 Example: assert len(filter(obj.is_mo_m_pym, obj.all_ms())) == len(list(all_pyms()))
def sds2.iterators.all_res (   args)
 All right ends in the job
 
 return itertools.imap(obj.mo_re, all_mns())
def sds2.iterators.all_vs (   args)
 All members views in the job
 
 return vs_on_ms(obj.all_ms())
def sds2.iterators.all_ws (   args)
 All welds in the job
 
 return ws_on_mo_ms(obj.all_ms())
def sds2.iterators.beams (   args)
 return ms_with_memt(obj.model.Beam, member_universe)
def sds2.iterators.bolts (   args)
 Bolts on members
 
 return iflatten(itertools.imap(obj.bolts_mo_m, ms(generic_members)))
 
 Example: assert model.BoltsOnMembers([obj.m(11), obj.m(12)]) == list(bolts([11,obj.m(12)]))
def sds2.iterators.bs (   args)
 Convert bolts ids to model.object bolts
 
 return itertools.imap(obj.b, bolt_ids)
 
 Example: assert [obj.b(11,0), obj.b(11,1)] == list(bs([(11,0), obj.b(obj.m(11),1)]))
def sds2.iterators.bs_created_by_creator_uuid_bytes (   args)
 Bolts on members in member_universe created by creator_uuid_bytes
 
 return filter_by_creator_uuid_bytes(creator_uuid_bytes, bolts(member_universe))
def sds2.iterators.bs_created_by_member_end_tuple (   args)
 Bolts on members in member_universe that are part of the (member, end) member_end_tuple
 
 return ifilter(
         lambda o: obj.b_end_conn_ij(o) == member_end_tuple
         , bolts(member_universe)
         )
def sds2.iterators.bs_on_mo_ms (   args)
 Bolts on model.object members
 
 return iflatten(itertools.imap(obj.bolts_mo_m, mo_ms))
 
 Example: assert model.BoltsOnMembers([obj.m(11), obj.m(12)]) == list(bs_on_mo_ms([obj.m(11), obj.m(12)]))
def sds2.iterators.columns (   args)
 return ms_with_memt(obj.model.Column, member_universe)
def sds2.iterators.components (   args)
 Components on members
 
 return cs_on_mns(mns(generic_members))
 
 Example: assert map(lambda x: x.uuid, obj.cs_on_mn(1)+obj.cs_on_mn(2)) == [x.uuid for x in components([obj.m(1), 2])]
def sds2.iterators.components_of_class (   args)
 Return all components of the given type in the member_universe
 
 return ifilter(
         lambda c: type(c) == T
         , all_cs() if member_universe is None else components(member_universe)
         )
def sds2.iterators.conn_components (   args)
 Return all connection components (i.e. builtin end components)
 
 return components_of_class(obj.Component.Component, member_universe)
def sds2.iterators.cs (   args)
 Convert component ids to components
 
 return itertools.imap(obj.c, component_ids)
 
 Example: assert [obj.c(1,0).uuid, obj.c(1,1).uuid] == [x.uuid for x in cs([(1,0),(obj.m(1),1)])]
def sds2.iterators.cs_on_mns (   args)
 Components on members
 
 return iflatten(itertools.imap(obj.cs_on_mn, member_numbers))
 
 Example: assert map(lambda x: x.uuid, obj.cs_on_mn(1)+obj.cs_on_mn(2)) == [x.uuid for x in cs_on_mns([1,2])]
def sds2.iterators.custom_members (   args)
 return ms_with_memt(obj.model.Custom, member_universe)
def sds2.iterators.custom_members_with_class_name (   args)
 return custom_members_with_class_name_in_names((cn, ), member_universe)
def sds2.iterators.custom_members_with_class_name_in_names (   args)
 return ifilter(
         lambda m: m.custom_member_type in names
         , custom_members(member_universe)
         )
def sds2.iterators.ends (   args)
 Return ends on members
 
 return es_on_mo_ms(ms(generic_members))
 
 Example: assert [obj.le(1), obj.re(1), obj.le(2), obj.re(2)] == list(ends([1,2]))
def sds2.iterators.es (   args)
 Convert end ids to ends
 
 return itertools.imap(obj.e, end_ids)
 
 Example: assert [obj.le(1), obj.re(1)] == list(es(((1,0), obj.e(1, 1))))
def sds2.iterators.es_on_mo_ms (   args)
 Return ends on model.object members
 
 return iflatten(itertools.imap(obj.ends_mo_m, mo_ms))
 
 Example: assert [obj.le(1), obj.re(1), obj.le(2), obj.re(2)] == list(es_on_mo_ms(ms((1,2))))
def sds2.iterators.filter_by_creator_uuid_bytes (   args)
 return ifilter(lambda i: obj.is_created_by_bytes(i, creator_uuid_bytes), iterable)
def sds2.iterators.flattened_mts_bs_ws_on_mo_ms (   args)
 return iflatten2(mts_bs_ws_on_mo_ms(ms))
def sds2.iterators.gen_materials (   args)
 Return gen_mtrls on members
 
 return itertools.imap(obj.mo_mt_to_gen_mt, mts_on_mo_ms(ms(generic_members)))
 
 Example: assert model.MaterialsOnMembers([obj.m(1), obj.m(2)]) == list(to_mos(gen_materials([1,2])))
def sds2.iterators.gen_mts (   args)
 Convert materials to gen_mtrls
 
 return itertools.imap(obj.gen_mt, mts(generic_materials))
 
 Example: assert [obj.gen_mt(1,0).modelobject(), obj.gen_mt(1,1).modelobject()] == list(
         to_mos(gen_mts([(1,0), obj.mt(1,1)]))
         )
def sds2.iterators.hbraces (   args)
 return ms_with_memt(obj.model.HBrace, member_universe)
def sds2.iterators.hlists (   args)
 hole_lists on materials
 
 return itertools.imap(obj.mo_h_to_hlist, holes(generic_materials))
 
 Example: assert model.HolesOnMaterials([obj.mt(1,0), obj.mt(1,1)]) == list(to_mos(hlists([obj.mt(1,0), (1,1)])))
def sds2.iterators.hlists_m (   args)
 hole_lists on member
 
 return itertools.imap(obj.mo_h_to_hlist, holes_m(generic_member))
 
 Example: assert model.HolesOnMaterials(obj.m(1).materials) == list(to_mos(hlists_m(1)))
def sds2.iterators.hlists_ms (   args)
 hole_lists on members
 
 return itertools.imap(obj.mo_h_to_hlist, holes_ms(generic_members))
 
 Example: assert model.HolesOnMaterials(materials([1,2])) == list(to_mos(hlists_ms([1,2])))
def sds2.iterators.holes (   args)
 Holes on materials
 
 return holes_mo_mts(mts(generic_materials))
 
 Example: assert model.HolesOnMaterials([obj.mt(1,0), obj.mt(1,1)]) == list(holes([obj.mt(1,0), (1,1)]))
def sds2.iterators.holes_m (   args)
 Holes on member
 
 return holes_mo_mts(materials([generic_member]))
 
 Example: assert model.HolesOnMaterials(obj.m(1).materials) == list(holes_m(1))
def sds2.iterators.holes_mo_mts (   args)
 Return holes on model.object materials
 
 return iflatten(itertools.imap(obj.holes_mo_mt, mo_mts))
 
 Example: assert model.HolesOnMaterials(obj.m(1).materials) == list(holes_mo_mts(obj.m(1).materials))
def sds2.iterators.holes_ms (   args)
 Holes on members
 
 return iflatten(itertools.imap(holes_m, generic_members))
 
 Example: assert model.HolesOnMaterials(materials([1,2])) == list(holes_ms([1,2]))
def sds2.iterators.hs (   args)
 Convert hole ids to model.object holes
 
 return itertools.imap(obj.h, hole_ids)
 
 Example: assert obj.mt(1,0).holes == list(hs(obj.mt(1,0).holes))
def sds2.iterators.iflatten (   args)
 return itertools.chain(itertools.chain.from_iterable(iterable))
def sds2.iterators.iflatten2 (   args)
 return iflatten(itertools.imap(lambda t: iflatten(t), iterable_of_iterables))
def sds2.iterators.imap_constructor_to_unpackable_indices (   args)
 return itertools.imap(lambda indices: cons(*indices), iterable)
def sds2.iterators.joists (   args)
 return ms_with_memt(obj.model.Joist, member_universe)
def sds2.iterators.le_conn_components (   args)
 return ifilter(obj.is_c_ref_pt_at_origin, conn_components(member_universe))
def sds2.iterators.les (   args)
 Return left ends on members
 
 return itertools.imap(obj.le, generic_members)
 
 Example: assert [obj.le(1), obj.le(2)] == list(les([member.Member(1), 2]))
def sds2.iterators.linked_ms (   args)
 return (ms_with_mem_link(mo_m.mem_link, member_universe) if mo_m.mem_link
         else itertools.chain((mo_m, ))
         )
def sds2.iterators.lua_modifies (   args)
 return lua_ms(iflatten(itertools.imap(obj.modifies_or_empty, xs)), member_universe)
def sds2.iterators.lua_ms (   args)
 Linked, unique, active members
 
 ms = member_universe if member_universe is not None else obj.all_ms()
 return iflatten(itertools.imap(
             lambda (k, g): linked_ms(list(g)[-1], ms) if k else g
             , itertools.groupby(
                 sorted(unique_active_ms(generic_members), key=lambda m: m.mem_link)
                 , lambda m: m.mem_link
                 )
             ))
def sds2.iterators.materials (   args)
 Return materials on members
 
 return mts_on_mo_ms(ms(generic_members))
 
 Example: assert model.MaterialsOnMembers(ms([1,2])) == list(materials([1, 2]))
def sds2.iterators.mbs (   args)
 Convert members to MemberBase members
 
 return itertools.imap(obj.mb, generic_members)
 
 Example: assert len(obj.all_ms()) == len(list(mbs(obj.all_ms())))
def sds2.iterators.mns (   args)
 Convert members to member numbers
 
 return itertools.imap(obj.hn, generic_members)
 
 Example: assert [1, 2] == list(mns((member.Member(1).Material(0), obj.re(2))))
def sds2.iterators.mns_from_mo_ms (   args)
 Convert members to member numbers
 
 return itertools.imap(obj.host_number_mo_m, mo_ms)
 
 Example: assert [1,2] == list(mns_from_mo_ms((obj.m(1), obj.m(2))))
def sds2.iterators.mns_from_mos (   args)
 Convert model objects to member numbers
 
 return itertools.imap(obj.host_number_mo, mos)
 
 Example: assert [1,2] == list(mns_from_mos((obj.le(1), obj.re(2))))
def sds2.iterators.mo_bs (   args)
 Convert bolt ids to bolts
 
 return imap_constructor_to_unpackable_indices(obj.mo_b, bolt_ids)
 
 Example: assert [obj.b(59,0), obj.b(59,1)] == list(mo_bs(((59,0), (59,1))))
def sds2.iterators.mo_es (   args)
 Convert end ids to ends
 
 return _imap_constructor_to_unpackable_indices(obj.mo_e, end_ids)
 
 Example: assert obj.m(1).ends == list(mo_es(((1,0), (1,1))))
def sds2.iterators.mo_hs (   args)
 Convert hole ids to holes
 
 return imap_constructor_to_unpackable_indices(obj.mo_h, hole_ids)
 
 Example: assert [obj.h(1,0,0), obj.h(1,0,1)] == list(mo_hs(((1,0,0), (1,0,1))))
def sds2.iterators.mo_les (   args)
 Convert member numbers to left ends
 
 return itertools.imap(obj.mo_le, member_numbers)
 
 Example: assert list(es(((1,0), (2,0)))) == list(mo_les((1, 2)))
def sds2.iterators.mo_ms (   args)
 Convert numbers to members
 
 return itertools.imap(obj.mo_m, numbers)
 
 Example: assert [obj.m(1)] == list(mo_ms([1]))
def sds2.iterators.mo_mts (   args)
 Convert material ids to materials
 
 return imap_constructor_to_unpackable_indices(obj.mo_mt, mtrl_ids)
 
 Example: assert [obj.mt(1,0), obj.mt(1,1)] == list(mo_mts(((1,0), (1,1))))
def sds2.iterators.mo_res (   args)
 Convert member numbers to right ends
 
 return itertools.imap(obj.mo_re, member_numbers)
 
 Example: assert list(es(((1,1), (2,1)))) == list(mo_res((1, 2)))
def sds2.iterators.mo_ws (   args)
 Convert weld ids to welds
 
 return imap_constructor_to_unpackable_indices(obj.mo_w, weld_ids)
 
 Example: assert [obj.w(1,0), obj.w(1,1)] == list(mo_ws(((1,0), (1,1))))
def sds2.iterators.ms (   args)
 Convert members to model.object members
 
 return mo_ms(itertools.imap(obj.hn, generic_members))
 
 Example: assert [obj.m(1), obj.m(2)] == list(ms((member.Member(1), member.Member(2).Material(0))))
def sds2.iterators.ms_intersecting_aabb (   args)
 Members whose axis aligned bounding box overlaps bb
 
 return ifilter(
         lambda m: obj.are_overlapping_aabbs(bb, obj.aabb_m(m))
         , member_universe if member_universe is not None else obj.all_ms()
         )
def sds2.iterators.ms_intersecting_aabb_c (   args)
 Members whose axis aligned bounding box overlaps the component's reference point
 
 return ms_intersecting_aabb_pt(c.ref_point_in_global, member_universe)
def sds2.iterators.ms_intersecting_aabb_e (   args)
 Members whose axis aligned bounding box includes the end location
 
 return ms_intersecting_aabb_pt(e.location, member_universe)
def sds2.iterators.ms_intersecting_aabb_m (   args)
 Members whose axis aligned bounding box overlaps mo's host member
 
 return ms_intersecting_aabb(obj.aabb_m(obj.m(mo)), member_universe)
def sds2.iterators.ms_intersecting_aabb_m_es (   args)
 Members whose axis aligned bounding box contains at least one of the member's
 end points
 
 return ms_intersecting_aabb_pt_strip(
         itertools.imap(
             lambda e: e.location
             , obj.m(mo).ends
             )
         , member_universe
         )
def sds2.iterators.ms_intersecting_aabb_origin (   args)
 Members whose axis aligned bounding box includes mo's origin
 
 return ms_intersecting_aabb_pt(obj.origin(obj.l2g(mo)), member_universe)
def sds2.iterators.ms_intersecting_aabb_pt (   args)
 Members whose axis aligned bounding box includes pt
 
 return ms_intersecting_aabb_seg_strip([pt], member_universe)
def sds2.iterators.ms_intersecting_aabb_pt_strip (   args)
 Members whose axis aligned bounding box includes at least one point in pts
 
 im = itertools.imap
 return unique_hosts(
         iflatten(im(lambda bb: ms_intersecting_aabb(bb, member_universe), im(obj.aabb_pt, pts)))
         )
def sds2.iterators.ms_intersecting_aabb_seg (   args)
 Members whose axis aligned bounding box overlaps mo's line segment
 
 return ms_intersecting_aabb_seg_strip(obj.seg(mo), member_universe)
def sds2.iterators.ms_intersecting_aabb_seg_strip (   args)
 Members whose axis aligned bounding box overlaps the aabb of all pts
 
 return ms_intersecting_aabb(obj.aabb_pt(*pts), member_universe)
def sds2.iterators.ms_line_has_c (   args)
 Members whose line segment contains the component's reference point
 
 return ms_line_has_pt(c.ref_point_in_global, member_universe, accy)
def sds2.iterators.ms_line_has_e (   args)
 Members whose line segment contains the end's location
 
 return ms_line_has_pt(e.location, member_universe, accy)
def sds2.iterators.ms_line_has_m_es (   args)
 Members whose line segment contains at least one of the member's end points
 
 return ms_line_has_pt_strip(
         itertools.imap(lambda e: e.location, obj.m(mo).ends)
         , member_universe
         , accy
         )
def sds2.iterators.ms_line_has_origin (   args)
 Members whose line segment contain's mo's origin
 
 return ms_line_has_pt(obj.origin(obj.l2g(mo)), member_universe, accy)
def sds2.iterators.ms_line_has_pt (   args)
 Members whose line segment contains p
 
 return ifilter(
         lambda m: m3d.PointOnLineSegment(pt(p), obj.seg(m), accy)
         , member_universe if member_universe is not None else obj.all_ms()
         )
def sds2.iterators.ms_line_has_pt_strip (   args)
 Members whose line segment contains at least one point in pts
 
 u = member_universe if member_universe is not None else obj.all_ms()
 return unique_hosts(
         iflatten(itertools.imap(lambda p: ms_line_has_pt(p, u, accy), pts))
         )
def sds2.iterators.ms_marked_for_process_or_solids (   args)
 ms_marked_for_process_or_solids(args)
def sds2.iterators.ms_with_mem_link (   args)
 Members sharing the same mem_link.
 
 Beware mem_link == 0 indicates member is not broken apart
def sds2.iterators.ms_with_memt (   args)
 return ms_with_memt_in_memts((memt,), member_universe)
def sds2.iterators.ms_with_memt_in_memts (   args)
 return ifilter(
         lambda m: m.memt in memts
         , obj.all_ms() if member_universe is None else member_universe
         )
def sds2.iterators.mts (   args)
 Convert material ids to model.object materials
 
 return itertools.imap(obj.mt, generic_materials)
 
 Example: assert [obj.mt(1,0), obj.mt(1,1)] == list(mts([(1,0), (1,1)]))
def sds2.iterators.mts_bs_ws_created_by_creator (   args)
 Materials, bolts, welds created by custom member or component
 
 ms = member_universe if member_universe is not None else list(lua_modifies([creator]))
 u = creator.uuid.bytes
 return (mts_created_by_creator_uuid_bytes(u, ms)
         , bs_created_by_creator_uuid_bytes(u, ms)
         , ws_created_by_creator_uuid_bytes(u, ms)
         )
def sds2.iterators.mts_bs_ws_created_by_end (   args)
 Materials, bolts, and welds on members in member_universe that are part of
 the (member, end) member_end_tuple
 
 ms = member_universe if member_universe is not None else list(ms_intersecting_aabb_e(e))
 ij = tuple(obj.ij_mo_e(e))
 return (mts_created_by_member_end_tuple(ij, ms)
         , bs_created_by_member_end_tuple(ij, ms)
         , ws_created_by_member_end_tuple(ij, ms)
         )
def sds2.iterators.mts_bs_ws_on_mo_ms (   args)
 return it.itertools.imap(lambda m: (m.materials, m.bolts, m.welds), ms)
def sds2.iterators.mts_created_by_creator_uuid_bytes (   args)
 Materials on members in member_universe created by creator_uuid_bytes
 
 return filter_by_creator_uuid_bytes(creator_uuid_bytes, materials(member_universe))
def sds2.iterators.mts_created_by_member_end_tuple (   args)
 Materials on members in member_universe that are part of the (member, end) member_end_tuple
 
 return ifilter(
         lambda o: obj.mt_end_conn_ij(o) == member_end_tuple
         , materials(member_universe)
         )
def sds2.iterators.mts_on_mo_ms (   args)
 Return materials on model.object members
 
 return iflatten(itertools.imap(obj.materials_mo_m, mo_ms))
 
 Example: assert model.MaterialsOnMembers(ms([1,2])) == list(mts_on_mo_ms(ms([1,2])))
def sds2.iterators.mts_with_mtrl_type (   args)
 return mts_with_mtrl_type_in_mtrl_types((mtrl_type,), member_universe)
def sds2.iterators.mts_with_mtrl_type_in_mtrl_types (   args)
 return ifilter(
         lambda mt: mt.mtrl_type in mtrl_types
         , obj.all_ms() if member_universe is None else member_universe
         )
def sds2.iterators.mts_with_use (   args)
 return mts_with_use_in_uses((use,), member_universe)
def sds2.iterators.mts_with_use_in_uses (   args)
 return ifilter(
         lambda mt: mt.mtrl_use in uses
         , obj.all_ms() if member_universe is None else member_universe
         )
def sds2.iterators.pycomponents (   args)
 Python components on members
 
 return ifilter(obj.is_pyc, components(generic_members))
 
 Example: assert [x.uuid for x in pycomponents(obj.all_ms())] == [x.uuid for x in all_pycs()]
def sds2.iterators.pycs_on_mn (   args)
 Python components on member
 
 return filter(obj.is_pyc, obj.cs_on_mn(member_number))
 
 assert [x.uuid for x in pycs_on_mn(1)] == [x.uuid for x in pycs_on_mns([1])]
def sds2.iterators.pycs_on_mns (   args)
 Python components on members
 
 return ifilter(obj.is_pyc, cs_on_mns(member_numbers))
 
 assert [x.uuid for x in pycs_on_mn(1)] == [x.uuid for x in pycs_on_mns([1])]
def sds2.iterators.re_conn_components (   args)
 return itertools.ifilterfalse(
         obj.is_c_ref_pt_at_origin
         , conn_components(member_universe)
         )
def sds2.iterators.res (   args)
 Return right ends on members
 
 return itertools.imap(obj.re, generic_members)
 
 Example: assert [obj.re(1), obj.re(2)] == list(res([member.Member(1), 2]))
def sds2.iterators.to_mos (   args)
 Convert generics to model.objects
 
 return itertools.imap(obj.to_mo, generics)
 
 Example: assert [obj.m(1), obj.mt(1,0), obj.h(1,0,0)] == list(to_mos((member.Member(1), obj.gen_mt(1,0), obj.hlist(1,0,0))))
def sds2.iterators.unique_active_ms (   args)
 return ifilter(
         lambda m: m is not None
         , unique(itertools.imap(obj.optional_m, generic_members))
         )
def sds2.iterators.unique_everseen (   args)
 seen = set()
 add = seen.add
 if key is None:
     for e in itertools.ifilterfalse(seen.__contains__, iterable):
         add(e)
         yield e
 else:
     for e in iterable:
         k = key(e)
         if k not in seen:
             add(k)
             yield e
 
 Example: assert (unique == unique_everseen
         and [obj.mt(1,0)] == list(unique(mts([obj.mt(1,0), (1,0), obj.gen_mt(1,0)])))
         and [obj.h(1,0,0), obj.m(1)] == list(unique([obj.h(1,0,0), obj.m(1), obj.h(1,0,0)]))
         )
def sds2.iterators.unique_hosts (   args)
 Return unique model.object mebers from members
 
 return unique_everseen(ms(generic_members), obj.host_number_mo_m)
 
 Example: assert [obj.m(1)] == list(unique_hosts(obj.m(1).materials))
def sds2.iterators.unique_hosts_from_mos (   args)
 Return unique model.object mebers from model.objects
 
 return mo_ms(mns_from_mos(unique_everseen(mos, obj.host_number_mo)))
 
 Example: assert [obj.m(1)] == list(unique_hosts_from_mos(obj.m(1).materials))
def sds2.iterators.unique_mns (   args)
 Return unique member numbers from members
 
 return unique_everseen(mns(generic_members))
 
 Example: assert [1] == list(unique_mns((obj.gen_mt(1,0), obj.hlist(1,0,0))))
def sds2.iterators.unique_mns_from_mos (   args)
 Return unique member numbers from model.objects
 
 return unique_everseen(mns_from_mos(mos))
 
 Example: assert [1] == list(unique_mns_from_mos(obj.mo_m(1).materials))
def sds2.iterators.vbraces (   args)
 return ms_with_memt(obj.model.VBrace, member_universe)
def sds2.iterators.vs (   args)
 Convert view ids to views
 
 return itertools.imap(obj.v, view_ids)
 
 Example: assert [obj.v(1,0), obj.v(2,0)] == list(vs([(obj.m(1), 0), (2,0)]))
def sds2.iterators.vs_on_ms (   args)
 Views on members
 
 return iflatten(itertools.imap(obj.vs_on_m, generic_members))
 
 Example: assert obj.vs_on_m(1) + obj.vs_on_m(2) == list(vs_on_ms([obj.m(1), 2]))
def sds2.iterators.welds (   args)
 Welds on members
 
 return iflatten(itertools.imap(obj.welds_mo_m, ms(generic_members)))
 
 Example: assert model.WeldsOnMembers([obj.m(1), obj.m(3)]) == list(welds([1, 3]))
def sds2.iterators.ws (   args)
 Convert welds ids to model.object welds
 
 return itertools.imap(obj.w, weld_ids)
 
 Example: assert [obj.w(1,0), obj.w(1,1)] == list(ws([obj.w(obj.m(1),0), obj.w(1,1)]))
def sds2.iterators.ws_created_by_creator_uuid_bytes (   args)
 Welds on members in member_universe created by creator_uuid_bytes
 
 return filter_by_creator_uuid_bytes(creator_uuid_bytes, welds(member_universe))
def sds2.iterators.ws_created_by_member_end_tuple (   args)
 Welds on members in member_universe that are part of the (member, end) member_end_tuple
 
 return ifilter(
         lambda o: obj.w_end_conn_ij(o) == member_end_tuple
         , welds(member_universe)
         )
def sds2.iterators.ws_on_mo_ms (   args)
 Welds on model.object members
 
 return iflatten(itertools.imap(obj.welds_mo_m, mo_ms))
 
 Example: assert model.WeldsOnMembers(obj.all_ms()) == list(ws_on_mo_ms(obj.all_ms()))