'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
'\\\\\\\\\\By Andrea Padovan Playstos entertainment\\\\\17-09-2002\\\\\\\\\\\\\\'
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
dim xmin, ymin, zmin, xmax, ymax, zmax
dim list, BboxList, Xcoor, Ycoor, Zcoor
dim NewName
set list = GetValue( "SelectionList" )
if list.count = 0 then
MsgBox "Please select an object or an Subcomponent!"
else
for each item in list
logmessage item.name
NewName = item
next
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
GetBBox list, TRUE , xmin , ymin , zmin , xmax , ymax , zmax
Xcoor = (xmin + xmax) / 2
Ycoor = (ymin + ymax) / 2
Zcoor = (zmin + zmax) / 2
LogMessage Xcoor
LogMessage Ycoor
LogMessage Zcoor
LogMessage xmin
LogMessage xmax
LogMessage ymin
LogMessage ymax
LogMessage zmin
LogMessage zmax
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
CreatePrim "Cube", "MeshSurface" , NewName & "_Bbox"
SetValue ".cube.length", 0.01
set BboxList = GetValue ("SelectionList")
Translate BboxList & ".poly[2]", xmin, 0, 0, siRelative, siGlobal, siObj, siX
Translate BboxList & ".poly[3]", xmax, 0, 0, siRelative, siGlobal, siObj, siX
Translate BboxList & ".poly[1]", 0, ymin, 0, siRelative, siGlobal, siObj, siY
Translate BboxList & ".poly[4]", 0, ymax, 0, siRelative, siGlobal, siObj, siY
Translate BboxList & ".poly[0]", 0, 0, zmin, siRelative, siGlobal, siObj, siZ
Translate BboxList & ".poly[LAST]", 0, 0, zmax, siRelative, siGlobal, siObj, siZ
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
Translate , Xcoor, Ycoor, Zcoor, siAbsolute, siView, siCtr, siXYZ
Logmessage "Completed!!!!!"
end if
