Saturday snippet – Getting local properties of scene items

This snippet gets the local properties of anything in the selection list that has local properties.

from win32com.client import constants as C

for o in Application.Selection:
	localProps = (o.LocalProperties if o.IsClassOf( C.siSceneItemID ) else None)
	if localProps != None:
		for p in localProps:
			print p 

LocalProperties is a property of any SceneItem, so all you have to do is check whether the selected object implements the SceneItem interface.