How do you get a count of selected objects?

262
1
06-06-2014 02:14 PM
LoringTupper
New Contributor
I've selcted a number of parcel polygon shapes in my Viewport, now I want my python script to get the number of polygons I've got selected so I can use that number in a calculation. The standard Python count fucntion does not seem to work and I don't see a ce command listed that does counting. From a python script how would I go about finding out how many shapes I've got selected?
Tags (3)
0 Kudos
1 Reply
LoringTupper
New Contributor
I did find a way to get the total number of shapes selected, I just created a list of the selection and used the len method to get the number of items in the list:
theShapeList=ce.getObjectsFrom(ce.selection(), ce.isShape)
size = len(theShapeList)
0 Kudos