Create Named Selectoin Sets based on scene's materials

Selection sets names should match corresponding materials names, of course.
Could someone help please?
Thanks

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
1rv's picture

Miauu, 1000 thanks! P.S. Is

Miauu, 1000 thanks!
P.S. Is it possible to modify so it'd create SelSets only from SELECTED objects?

miauu's picture

.

From materials applied to the selected objects?
Can you provide a test scene?

1rv's picture

I PMed you

I PMed you

miauu's picture

.

(	
	for sceneMat in sceneMaterials do
	(
		theObjsArr = for n in (refs.dependents sceneMat) where superClassOf n == GeometryClass collect n
		selectionSets[sceneMat.name] = theObjsArr
	)
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.