ScriptSpot

Forum topic · General Scripting

Maxscripting

By HaykKhalatyan · 2016-04-11

Description

Hi guys!

I am trying to do script which can help me do one task faster.
Need to select all scene objects then add edit poly modifier and select edge by index number one.
I have done part, but it doing task for one object. but need to do for all scene objects.

select $box001
subobjectLevel = 2
$.EditablePoly.SetSelection #Edge #{1}
subobjectLevel = 0
max hide selection ()

Can anyone help me with this ?

Thanks!

Comments (1)

.

miauu · 2016-04-13

This will select the edge with index 1 of all objects. When one Edit Poly modifeir is applied to multiple objects the selection of edges is not as when the Edit poly object is applyed to only one object. In your case every object in selection have edge with index 1.


(
	objsArr = objects as array
	
	if objsArr.count != 0 do
	(
		select objsArr
		max modify mode
		modPanel.addModToSelection (Edit_Poly())
		epMod = modPanel.getCurrentObject()
		subobjectLevel = 2
		for o in objsArr do
			epMod.Select #Edge #{1} node:o
		subobjectLevel = 0
		max hide selection ()
	)
)