def outputFunc(objs):
    """Extracts the bottom faces of each solid in selection

    Args:
        objs (list of ids): list of ids

    Returns:
        list: list of bottom faces
    """

    rs.EnableRedraw(False)
    bottomFaces = []
    for obj in objs:
        resultFaces = trp.getBottomFace(obj)
        # print resultFaces
        for resultFace in resultFaces:
            trp.copySourceLayer(resultFace, obj)
            try:
                trp.copySourceData(resultFace, obj)
            except:
                pass
            bottomFaces.append(resultFace)
    rs.SelectObjects(bottomFaces)
    group = rs.AddGroup()
    rs.AddObjectsToGroup(bottomFaces, group)
    rs.EnableRedraw(True)
    return bottomFaces
Beispiel #2
0
def massFromSrf(obj):
    lvl = levels[rs.GetUserText(obj, 'level')]
    height = float(lvl['height'])
    startpt = trp.objBBPts(obj)[0]
    endpt = (startpt.X, startpt.Y, startpt.Z + height)
    curve = rs.AddLine(startpt, endpt)
    mass = rs.ExtrudeSurface(obj, curve)
    trp.copySourceLayer(mass, obj)
    trp.copySourceData(mass, obj)
    rs.DeleteObject(curve)
    return mass
def outputFunc(objs):
    rs.EnableRedraw(False)
    bottomFaces = []
    for obj in objs:
        resultFaces = trp.getBottomFace(obj)
        # print resultFaces
        for resultFace in resultFaces:
            trp.copySourceLayer(resultFace, obj)
            try:
                trp.copySourceData(resultFace, obj)
            except:
                pass
            bottomFaces.append(resultFace)
    rs.SelectObjects(bottomFaces)
    group = rs.AddGroup()
    rs.AddObjectsToGroup(bottomFaces, group)
    rs.EnableRedraw(True)
    return bottomFaces
Beispiel #4
0
def createHatch(obj):
    hatch = trp.hatchFromSrf(obj)
    trp.copySourceLayer(hatch, obj)
    return hatch