ScriptSpot

Forum topic · General Scripting

Measuring Area

By Grant · 2007-04-04

Description

Is there any way of measuring area in 3D Studio Max?  I need to be able to select a number of vertices or a mesh object and measure the enclosed area.  These are all irregular meshes so it isn't simply using the Measure Distance Tool.

Ideally I'd like to see the area as I deform the object.

Does anyone know of any existing scripts?

Grant

Comments (5)

Why don't select some faces

arketip · 2007-04-05

Why don't select some faces and calculate sum of the area of each selected face ? (meshop.getFaceArea)

That will be easy to code.

Grant · 2007-04-05

Thanks Arketip.  Not so easy for someone that doesn't know how to code but I'm clearly going to have to learn.  Knowing there is a meshop function get FaceArea will help.

arketip · 2007-04-05

 I assume you use meshes. Then here is the code:

 (

local obj= selection[1]

local theFaces= getFaceSelection obj

local theArea= meshop.getFaceArea obj theFaces

messageBox("The Area = "+(theArea as string))

)--local scope

Or with a macro: useful to create a shorcut or quad menu with it

macroscript GetAreaMacro

    category:"toolBox"

    buttonText:"GetArea"

    toolTip:"GetArea"

(

local obj= selection[1]

local theFaces= getFaceSelection obj.mesh

local theArea= meshop.getFaceArea obj.mesh theFaces

messageBox("The Area = "+(theArea as string))

)

Evaluate the macroscript and add a shortcut or quad menu for example by using the category "toolBox" (if you are not familiar with macroscripts, take a look at "MacroScripts for New Users" is the help of maxscript)

About the unit used by the surface Im not sure that will be right.

Grant · 2007-04-05

Arketip,

That was very kind!  Thank you for taking the time.  If you're ever in Tacoma or Winthrop, I owe you some wine.

Thanks,

Grant

Question...

THINKTANK · 2016-11-03

Hi! bit of an old post but still very valid for my needs,

I need to be able to select multiple objects (each object is 1 flat mesh) and all I want is for each object to work out it's area and rename it self to that number.... how could I achieve this to multiple meshes?

any help would be fantastic!