Kubotek Forum

KeyCreator CAD & CKD Viewer Technical discussion of CAD/CAM and integrated partner products
Subscribe to post
User avatar
Soli - (5/5/2020 6:42:44 AM)
KXL command : GetFastenerData
This KXL function works in KeyCreator 2020 only.
This is very useful for me to add Entity name for Fasteners and to build BOM.
I'm working for one customer with KeyCreator 13.5.
Kubotek, can you add this function for KeyCreator 13.5 too?
Or, alternatively to add a simmilar CDE function?

Here are the codes in KeyCreator 2020

---------------------------------------------------------------------------------------------------
:read_entity
clear hEnt , hLev
HENTITY hEnt
HLEVEL hLev
int nSelFlag = 0
Int  nSelParent = 1
Int  bSelRefEnts = 0
Int  bAccept = 1
bActiveInstFlag = 1
// Selection of Fasteners only
MASKENTITY 0, 35
MASKMAINTAIN 1
GetEnt "Select the component to set the Entity Name", hEnt,  , nSelFlag, nSelParent, bSelRefEnts,  , bAccept, bActiveInstFlag
if (@key == -3)
goto end
ENTLEVEL hEnt, hLev
//GetFastenerData
clear  $strType , $strLength ,$strThreadLen
string $strType , $strLength , $strThreadLen
 
GetFastenerData hEnt ,  $strType,  $strLength, $strThreadLen
//Retrieves the type and size data of a fastener.
// hFastener
//The Handle to the fastener entity
// strType
//The returned string of the type
// strLength
//The returned string of the part length
// [strThreadLen]
//The returned string of thread length
clear $new_name
string $new_name
sprint $new_name , "%s \nsize %s" , $strType ,  $strLength
:create_entity_name
StrMakeUpper $new_name
SetLevelDescriptor hLev, $new_name
setLevel hLev
notestate
clear $$acsStandard , $$acsUser
SList  $$acsStandard
SList  $$acsUser
Sprint  $$acsStandard[1] , "%s" ,  $new_name
SetEntityProperties hEnt , $new_name , $$acsStandard , $$acsUser
notestate
goto read_entity
:end
MASKCLEAR
MASKMAINTAIN 0

-------------------------------------------------------------------------------------

Thank you Kubotek
Login