Kubotek Forum

KeyCreator CAD & CKD Viewer Technical discussion of CAD/CAM and integrated partner products
Subscribe to post
User avatar
Soli - (7/27/2020 12:49:09 PM)
RE:BOM
Hear is how to retrieve the Entity User Properties.
Let say the name of variables are T TREAT and COAT
The values are 58-62 HRC and BLACK OXIDE

The macro look for the names T TREAT and COAT
When are found, the values are the next member of $$acsUser
--------------------------------------------------------------------------
:read_entity
clear hEnt , hLev , $name_from_level , $coating , $quantity ,$treatment , $sheet_number , $nEntID 
HENTITY hEnt 
HLEVEL hLev
string $name_from_level , $coating , $quantity ,$treatment , $sheet_number,  ,$nEntID 
clear $$table 
SList  $$table 
 
int nSelFlag = 0
Int  nSelParent = 1
Int  bSelRefEnts = 0
Int  bAccept = 1
bActiveInstFlag = 1
 
int coat = 0
int quantity = 0
int sheet = 0
int treat = 0
int fnumber = 0
 
MASKENTITY 0, 32 ,26 ,35
MASKMAINTAIN 1
 
GetEnt "Select the component to verify", hEnt,  , nSelFlag, nSelParent, bSelRefEnts,  , bAccept, bActiveInstFlag 
if (@key == -3)
goto end
 
MASKCLEAR
MASKMAINTAIN 0
 
ENTLEVEL hEnt, hLev 
GETLEVELINFO hLev , $name_from_level
 
clear nEntID
Int nEntID 
GetIDFromEnt hEnt , nEntID 
 
clear $$acsStandard , $$acsUser
 
SList  $$acsStandard
SList  $$acsUser
getEntityProperties hEnt, $csName , $$acsStandard , $$acsUser
 
clear members
int members
members = sizeof($$acsUser)
//pause "%d" , members
 
:loop_treat
if (treat == members)
pause "NO TREAT"
if (treat == members)
goto loop_coat
int nResult
clear nResult
strcmp $$acsUser[treat] , "T TREAT" , nResult
if (nResult == 0)
sprint $treatment , $$acsUser[treat+1] 
if (nResult == 0)
pause "TREAT=%s" , $treatment 
if (nResult == 0)
goto loop_coat
treat = treat + 3
goto loop_treat
 
:loop_coat
if (coat == members)
pause "NO COAT"
if (coat == members)
exit
int nResult
clear nResult
strcmp $$acsUser[coat] , "COAT" , nResult
if (nResult == 0)
sprint $coating, $$acsUser[coat+1]
if (nResult == 0)
pause "COAT=%s" ,  $coating
if (nResult == 0)
exit
coat = coat + 3
goto loop_coat

Login