Notifications
Clear all

[Closed] How to convert face selection to element

I’m having difficulty getting this function to work. :-

<integer>ConvertSelection <enum>fromLevel <enum>toLevel requireAll:<bool>

Assuming I have an editablepoly, with an edit-poly at the top of the stack… this is how I think I should be able to get this working.

theMod = modpanel.getcurrentobject()
 theMod.setSelection #face #{1}
 theMod.convertSelection #face #object 

When I run this, the listener returns ‘0’
I dont understand what I’m doing wrong here, or how else I could achieve the same result (ie select an element based on face selection) .

I’m trying to do this so I can iterate through every element in an editable poly. If there is an easier way to cyce through the elements of an editable poly than going through the poly face by face and selecting the element by face, please tell me!

Thanks in advance for your help.

2 Replies

Hi look for
‘getElementsUsingFace’ in MaxScript Help

TheMod=modpanel.getcurrentobject()
TheMod.setSelection #face (PolyOp.getElementsUsingFace $ 1)

Thanks zbuffer. I didnt manage to get it working, but I found a workaround in my script that meant I didnt need to get element from face.

Thanks for the suggestion anyhoo!