Maxscript - Can't get the getArea() method right

Hey all,
Firstly to say hi to everyone and I hope that you are all doing great.

First time posting here, so please don’t mind me if I didn’t format my question right!
I need some clarification with getArea() method (maxscript).
The max documentation is a bit unclear about the arguments.
What I need is to get the area within UV space, that faces are occupying. Percentage-wise or any other… Here is my code so far (I am getting 0 as returned (I guess I should supply the arguments, but not sure with what? :slight_smile:

facesArea = 0
facesFromUVArea = 0
faceSel = polyop.getFaceSelection $
fSel = faceSel as array
uvArea = 0f

x = 0.0                                                                                                     
y = 0.0                                                                                                     
refwidth = 0.0                                                                                                 
refheight = 0.0


for i=1 to fSel.count do 
(
	f = polyop.getFaceArea $ fSel[i]
	facesArea += f
)

uvw = addModifier $ (UVWUnwrap())
currMod = modPanel.getCurrentObject()
uvFacesSel = currMod.getSelectedFaces()
$.modifiers["Unwrap_UVW"].getArea uvFacesSel $x $y $refwidth $refheight $uvArea $facesArea

format "UVW area is: % face area is: % width is: %" uvArea facesArea refX

Much appreciated for any help,
Cheers!

After a few cups of coffee, playing with my 2-year-old, shaking my head a bit, having fresh air, I went back to my code and noticed a typo. I have been passing arguments with $ symbol instead of “by reference parameter passing” symbol: &.
Anyways it works now. And if it helps whoever reads this, at least as a reminder, to slow down and pay attention to typos, as well as not buying keyboards with flashy keys and weird symbols.

facesArea = 0
facesFromUVArea = 0
faceSel = polyop.getFaceSelection $
fSel = faceSel as array
uvArea =0.0
geoArea = 0.0

x = 0.0                                                                                                     
y = 0.0                                                                                                     
refwidth = 0.0                                                                                                 
refheight = 0.0


for i=1 to fSel.count do 
(
	f = polyop.getFaceArea $ fSel[i]
	facesArea += f
)

uvw = addModifier $ (UVWUnwrap())
currMod = modPanel.getCurrentObject()
uvFacesSel = currMod.getSelectedFaces()
 $.modifiers["Unwrap_UVW"].GetArea uvFacesSel &x &y &refwidth &refheight &uvArea &geoArea


format "UVW area is: % from uv face area is: % width is: % face area is: %" uvArea geoArea refwidth facesArea

Cheers!