Kubotek Forum

KeyCreator & KeyCreator Viewer Technical discussion of CAD/CAM and integrated partner products
Kubotek Forum > KeyCreator & KeyCreator Viewer > Entity name for fasteners View modes: 
User avatar
Advanced member
Advanced member
Soli - 4/27/2021 5:15:09 AM
   
Entity name for fasteners
This utility selects all fasteners in the model and saves the entity name and standard properties name for each fastener.
Works with KeyCreator 2020 and 2021 only.

---------------------------------------------------------------------- 
CLEAR nNumSel
INT nNumSel
maskentity 35
  // This will invoke the Universal Selection Menu
  
 
GenSel "Select solids to be analized...",  nNumSel, 0, 1, 0, 0, 1, 0
  if (@error != 0)
      EXIT
  CLEAR aGenSelEnts
  //Populate variable with the entities just selected
 
//copy selected entities to aGenSelEnts
GETSELECTED aGenSelEnts
 
clear $message
string $message
 
sprint $message , "NUMBER OF SELECTED ENTITIES = %d\nCONTINUE?" , nNumSel 
 
Int  nType = 4
MessageBox $message,  nType 
if (@error == 7)
goto end
 
clear number
int number
number=0
:loop
 
clear hEnt 
HENTITY hEnt 
HCopy  hEnt , aGenSelEnts[number]
 
clear hLev 
HLEVEL hlev
ENTLEVEL hEnt, hLev 
 
//GetFastenerData
 
clear  $strType , $strLength ,$strThreadLen
string $strType , $strLength , $strThreadLen
 
GetFastenerData hEnt ,  $strType,  $strLength, $strThreadLen
 
clear $new_name
string $new_name
 
sprint $new_name , "%s\|eolSIZE %s" , $strType ,  $strLength
//Create entity name and Standard properties 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
 
if (number > nNumSel-2)
goto end
number=number+1
goto loop
 
goto read_entity
 
:end
MASKCLEAR
MASKMAINTAIN 0
--------------------------------------------------------------------------------------
Solomon Steinberg,
Israel

DELL OPTIPLEX 7050
NVIDIA QUADRO P2000
KEYCREATOR 13.5
KEYCREATOR 2021 SP0



User avatar
Advanced member
Advanced member
Hans_Winkler - 4/27/2021 5:24:21 PM
   
RE:Entity name for fasteners
Thank you for sharing Solomon!

User avatar
Advanced member
Advanced member
Soli - 4/28/2021 3:19:30 PM
   
RE:Entity name for fasteners
Hans,
You shared too.
I learned a lot from you.
Kubotek can add entity name, automatically, for fasteners.
Without entity name, how is possible to build B.O.M?
Solomon Steinberg,
Israel

DELL OPTIPLEX 7050
NVIDIA QUADRO P2000
KEYCREATOR 13.5
KEYCREATOR 2021 SP0



1
Login