PolyExtrudeFacet random distance


#1

Hi,

I’ve created a polygon cube and added subdivisions. I’m trying to use the polyExtrudeFacet command to extrude and change the faces on top of the mesh using Python. So far I’ve got

cmds.polyExtrudeFacet(ltz=2, off=1, ran=0.3)

But I was wondering if there was a way to extrude the faces at random distances? I’ve tried a few different thinks, like random.randint, but I have no idea what I’m doing.
Also, is there anyway of automatically selecting only the top faces of a model using Python, rather than manually selecting them?

Any help would be really appreciated.

Thanks.