Component selection via Object Model


from AL.xsi import xsi, log, c, utils
 
lSubCompSel = []
for eachObj in xsi.Selection:
 
    oGeo = eachObj.ActivePrimitive.Geometry
    oSubComp = oGeo.CreateSubcomponent(c.siPolygonCluster, range(4))
    lSubCompSel.append(oSubComp)
 
log(",".join([str(x) for x in lSubCompSel]))
xsi.Selection.SetAsText(",".join([str(x) for x in lSubCompSel]))