Kubotek Forum

KeyCreator CAD & CKD Viewer Technical discussion of CAD/CAM and integrated partner products
Subscribe to post
User avatar
Soli - (3/15/2021 4:46:01 AM)
RE:Verify Mass Properties
This macro returns the weight as a string:
----------------------------------------
clear hEnt
HENTITY hEnt
 
:start
int nSelFlag = 0
Int  nSelParent = 1
Int  bSelRefEnts = 0
Int  bAccept = 1
bActiveInstFlag = 1
GetEnt "Select entity", hEnt,  , nSelFlag, nSelParent, bSelRefEnts,  , bAccept, bActiveInstFlag 
if (@key == -3)
exit
 
double weight[1]
 
VerifyMassProperties hEnt ,  ,   ,  ,  , 1,  , weight
notestate
 
VerifyMassProperties hEnt ,  ,  ,  ,  , 1,  , weight
notestate
 
weight[0] = weight[0]/1000
 
clear $weight
string $weight
sprint $weight , "%.2f" , weight[0]
 
pause "WEIGHT IS %s KG" , $weight
 
goto start
---------------------------------------------------------------------------

Ram,
Thank you again.
Login