Select object by name

Hi everyone. I need a script to select an object with keyword. If Obj1, Obj2, Obj3,Obj39, Mesh2, Mesh2, Pace1, pace2

I need to select object which has only with Obj and mesh (User needs to enter)

kindly help me in this regards

Sample I used

d = ($'*obj*')

for n in d collect n.name

select d

but I need to add multiple keywords

Comments

Comment viewing options

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

.

(
	strArr = #("obj*", "mesh*")
	objsToSelArr = #()
	for str in strArr do
	(
		for o in objects where matchPattern o.name pattern:str do 
			append objsToSelArr o			
	)
	select objsToSelArr
)

Comment viewing options

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