Hi Mike and Jeff,
I do it this way:
Sorry its a copy paste from a larger function so you need to make it into a function yourself
newobj = CloneObject(mggobjectid)
meshes = GetObjectNumMeshes( newobj )
hx# = -9999
lx# = 9999
hy# = -9999
ly# = 9999
hz# = -9999
lz# = 9999
// find object size x,y,z
for a = 1 to meshes
newmem = CreateMemblockFromObjectMesh(newobj,a)
numvert = GetMemblockInt(newmem,0)
numindices = GetMemblockInt(newmem,4) // 0 = 3 vert-polygon , > 0 shared vert.
numattributes = GetMemblockInt(newmem,8) // attributes per vertex,
numsinglevertsize = GetMemblockInt(newmem,12) // size of a single vertex
offsetvert = GetMemblockInt(newmem,16) // start off vertex data
offsetindex = GetMemblockInt(newmem,20) // start off indices data
for b = 1 to numvert
vx# = GetMeshMemblockVertexX( newmem, b )
vy# = GetMeshMemblockVertexY( newmem, b )
vz# = GetMeshMemblockVertexZ( newmem, b )
if vx# > hx# then hx# = vx#
if vx# < lx# then lx# = vx#
if vy# > hy# then hy# = vy#
if vy# < ly# then ly# = vy#
if vz# > hz# then hz# = vz#
if vz# < lz# then lz# = vz#
//disdebug( "vert " + str(b) + ": " + str(vx#) +","+ str(vy#) +","+ str(vz#) +"," )
next b
DeleteMemblock(newmem)
next a
DeleteObject(newobj)
objsizex# = hx# - lx#
objsizey# = hy# - ly#
objsizez# = hz# - lz#
It will just look at all vertex data in the object , and take the highest and lowest values.
objsizex# objsizey# objsizez# is the size of the object.
Hope you can use it.
best regards Preben Eriksen,