Kubotek Forum

KeyCreator CAD & CKD Viewer Technical discussion of CAD/CAM and integrated partner products
Subscribe to post
User avatar
Soli - (3/13/2021 4:42:56 AM)
RE:Verify Mass Properties
Ram, Hello

Thank you for your help.
This function can be very valuable for me.
But something went wrong with it.
The "adCentersOfMass" parameters only, are returned.
Others give an error.

I tried this code:
------------------------------------------------
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 adVolumes[1]
Double adMasses[1]
Double adSurfAreas[1]
Double adCentersOfMass[3] 
 
VerifyMassProperties hEnt ,  ,  ,  ,  , 1, adVolumes, adMasses, adSurfAreas,  , adCentersOfMass
 
notestate
 
pause "%d  %d  %d " , adCentersOfMass[0] ,adCentersOfMass[1],adCentersOfMass[2] 
pause "%d " , adMasses
goto start
----------------------------------------------------

I recorded the function Verify>Mass Properties:
----------------------------------------------
// Begin Macro Record
// This Macro is intended to be a Macro Script
 
// (0xA5A5) Compute mass properties of a body
MASKENTITY 32 
MASKENTITY 52 
MASKENTITY 41 
MASKENTITY 26 
Clear aBodies
HEntity aBodies[1] = { 49566 }
 
Clear aGenSelLevels
HLevel aGenSelLevels[0]
 
clear aCoM
double aCoM[3]
VerifyMassProperties aBodies,,,,,,,,,,aCoM
NoteState
MASKENTITY 32 
MASKENTITY 52 
MASKENTITY 41 
MASKENTITY 26 
// End Macro Record
----------------------------------------------------
The same, only, center of mass parameters are returned.

Can you check, please?

Thanks

Login