Category Archives: Max Script

Select Instance of Object (Max Script)

Select instances of object
This function is select to instances of any object:

fn selectAllInstanceObj obj=
(
	if(obj == undefined) then
	(
		return format"Object undefined" 
	)
	result = #()	
	instanceMgr.getInstances obj &instances	
	instCount = instances.count 
	
	for i = 1 to instCount do
	(
		areRef = ((obj != instances[i]) and not (areNodesInstances obj instances[i]) )
		if( not areRef) then
		(
			join result  #(instances[i])
		)
	)
	
	select result
)