thanks but it selects only one random edge On Monday, June 1, 2020 at 1:26:41 PM UTC+5:30, MichaelEden wrote: > > # import random module, documentation is here: > # https://docs.python.org/3/library/random.html > import random > > # select the object > selection = cmds.ls(sl=True)[0] > # calculate how many edges this object have > maxRandomValue = cmds.polyEvaluate(edge=True) > > # select the random edges of the object selected > cmds.select("{}.e[{}]".format(selection, random.randint(0,maxRandomValue))) > > # print > print "{} is selected".format(cmds.ls(sl=True)[0]) > > > hopefully it helps. cheers. > > > On Monday, June 1, 2020 at 4:38:03 PM UTC+9, Vishal Kadam wrote: >> >> Hello, >> >> can anyone help me, I want to select random edges using python script, as >> we do that from polygon selection constraint on edges then adjusting the >> count using ratio value >> >
-- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0c420a1e-511e-4c36-8cce-622810d0c951%40googlegroups.com.