Kubotek Forum

KeyCreator & KeyCreator Viewer Technical discussion of CAD/CAM and integrated partner products
Kubotek Forum > KeyCreator & KeyCreator Viewer > BOM View modes: 
User avatar
Member
Member
Yigal D - 7/18/2020 12:46:10 PM
   
BOM
Hello
I'm trying to create a BOM for a machine that I designed.
The project is made as an assembly with several sub assemblies, and some more connecting parts in between.
I have learned the BOM tutorials on Kubotek University, and used some of them.
When I'm trying to create BOM from Levels, by using virtual Obj, I don't get any sub-sub-level as a part for the BOM, and I have to enter them manually.
for exemple, for the Level Tree, I get only the Belt Connector (Level 6) without any  Sub Level.


I tried marking "Entites on main levle and sub levels" and  "Solids on main level and sub levels" but there is no change.

Am I missing somthing? 

Is there any other option for creating BOM?
I tried to find a KXL program that creates the BOM but haven't find yet.
Does anyone use the OpenBOM option? is it worth the extra money?

Thanks in advance
Uri 



User avatar
Valued member
Valued member
wkrol@kubotek3d.com - 7/20/2020 8:47:23 AM
   
RE:BOM
Hi Uri,

The BOM by levels does not take names of the sub-levels only counts the number of entities to get the quantity count in BOM.  One thing to try would be to move (in a temp file of assembly) the sub levels to the left to be main levels.  You might want to do ths for each sub-assembly.

There are other possiblites, Can you send file.  I'll email you my contact info

-Wes

User avatar
Advanced member
Advanced member
Dana - 7/27/2020 7:51:20 AM
   
RE:BOM
Rather than creating the BOM from levels using virtual objects, use the actual solids.  Using generic edit*, open the "standard properties" page for each solid.  Here, you can set part number, description, vendor, etc.  Then you create a BOM (using a previously created template), pick "add/remove entities", and presto, you have a BOM listing all the parts and quantities.

* or rather than using generic edit, here is a kxl I use, which allows you to set multiple solids at the same time:



// EntProps.kxl
// D.M. Hague 2019
// This program applies specified properties to selected entities for later BOM use


:select
MASKCLEAR
MASKENTITY 32, 52, 35, 36, 8, 6  // Solids, sheets, DP fasteners, mech elements, composites, splines
CLEAR hEnt, hFace, hInst, hdialog, hlev, hsel, nument, num, $level
cancel = 0
GETENTM "Select Entities:", 1, nument, 0, 1, 0, 0
//er = @error
//pause "%i %i %i", nument, er, @key
IF (@key < 0)
    cancel = 1
IF (cancel == 1)
    GOTO end
GetSelected hsel

GetNext type // to determine if first entity selected is a fastener
// pause "entity is type %i", type

// take information for dialog from first selected entity
GetEntityProperties hsel[0], $name, $$acsStandard, $$acsUser
EntLevel hsel[0], hlev

GetLevelInfo hlev, $level
SPRINT $partnum, $$acsStandard[0]
SPRINT $descrip, $$acsStandard[1]
SPRINT $createdby, $$acsStandard[2]
SPRINT $keywords, $$acsStandard[3]
SPRINT $savedby, $$acsStandard[4]
SPRINT $revision, $$acsStandard[5]
SPRINT $material, $$acsStandard[6]
SPRINT $vendor, $$acsStandard[7]
SPRINT $comment, $$acsStandard[8]

if (type != 35) // DP fastener
    GOTO notfast
STRING $Type, $Length, $ThdLength
GetFastenerData hsel[0], $Type, $Length, $ThdLength
//pause "error is %i", @error
//pause "%s    %s    %s", $Type, $Length, $ThdLength
SPRINT $descrip, $Type
SPRINT $partnum, $Length
SPRINT $name, "%s %s", $partnum, $descrip
//GOTO end

:notfast

StrLen $name, namlen
IF (namlen == 0) // name isn't set yet, so get it from the level
    SPRINT $descrip, $level // set description from level name

:dialog
cancel = 0
width = 90
height = 20
dg_init_dialog height, width,,"Edit Properties"
hdialog = @error
dg_add_button hdialog, 1, height-3, 10, 10, "Cancel",,,8
dg_add_button hdialog, 2, height-3, width-20, 10, "OK",,,8192
dg_add_note hdialog, 3, 2, 3, "Name "
dg_add_text_string hdialog, 4, 2, 15, width-19, , $name
dg_add_note hdialog, 5, 4, 3, "Part Number"
dg_add_text_string hdialog, 6, 4, 15, width-30, , $partnum
dg_add_note hdialog, 9, 4, width - 14, "Rev."
dg_add_text_string hdialog, 10, 4, width - 9, 5, , $revision
dg_add_note hdialog, 7, 6, 3, "Description"
dg_add_text_string hdialog, 8, 6, 15, width-19, , $descrip
dg_add_note hdialog, 11, 8, 3, "Vendor"
dg_add_text_string hdialog, 12, 8, 15, width-19, , $vendor
dg_add_note hdialog, 13, 10, 3, "Comment "
dg_add_text_string hdialog, 14, 10, 15, width-19, , $comment
dg_draw_dialog hdialog
dg_move_focus hdialog, 6
dg_run_dialog hdialog
if (@error == 1) //cancel
    cancel = 1
if (cancel == 1)

    GOTO close

dg_get_text_string hdialog, 4
SPRINT $name, @strdat
dg_get_text_string hdialog, 6
SPRINT $partnum, @strdat
SPRINT  $$acsStandard[0], $partnum
dg_get_text_string hdialog, 8
SPRINT $descrip, @strdat
SPRINT  $$acsStandard[1], $descrip
dg_get_text_string hdialog, 10
SPRINT $revision, @strdat
SPRINT $$acsStandard[5], $revision
dg_get_text_string hdialog, 12
SPRINT $vendor, @strdat
StrLen $vendor, venlen
IF (venlen == 0) // vendor isn't set yet
    SPRINT $vendor, "-"
SPRINT $$acsStandard[7], $vendor
dg_get_text_string hdialog, 14
SPRINT $comment, @strdat
SPRINT $$acsStandard[8], $comment

StrLen $name, namlen
IF (namlen == 0) // name isn't set yet
    SPRINT $name, "%s %s", $partnum, $descrip

SetEntityProperties hsel, $name, $$acsStandard, $$acsUser

:close
dg_erase_dialog hdialog
dg_free_dialog hdialog

:end
   CLEAR hEnt, hFace, hInst, hdialog, nEntType, nEnts, nFaces, ID, i, $Name, $$acsStandard, $$acsUser, hsel, nument
   CLEAR $name, $partnum, $revision, $descrip, $vendor, $comment
   MASKCLEAR
   CLEARSEL
  IF (cancel == 0)
    GOTO select
   EXIT

User avatar
Member
Member
Yigal D - 7/27/2020 10:05:31 AM
   
RE:BOM
Hello Dana

I talked with Wes and Soli about creating BOM from solids, and now I will try to learn this method using some macros.

Thank you very much
Uri 

User avatar
Advanced member
Advanced member
Soli - 7/27/2020 10:52:04 AM
   
RE:BOM
Dana, Hello,

I have something similar.
I also use Entity Standart Properties but I use Entity User Properties to keep
Quantity, Termic Treatment and Coating for specific components,
I input Quantity manually.

For Fastner I use Entity Name instead of  Entity Standart Properties 
The program counts the quantity, automatically.

How did you solved the quantity for specific components?

I use the same parameters to create an associative Label in the component dreawigs.

-----------------------------------------------------
clear hEnt , $number , $name , $quantity , $material , $treatment ,$coating , $scale  , $tool_number ,$nEntID 
HENTITY hEnt
string $number , $name , $quantity , $material , $treatment , $coating , $scale ,$tool_number ,$nEntID 
clear number
int number
 
:start
int nSelFlag = 0
Int  nSelParent = 1
Int  bSelRefEnts = 0
Int  bAccept = 1
bActiveInstFlag = 1
MASKENTITY 0, 32 ,26 ,35
MASKMAINTAIN 1
 
GetEnt "Select the component to get Label", hEnt,  , nSelFlag, nSelParent, bSelRefEnts,  , bAccept, bActiveInstFlag 
if (@key == -3)
goto end
 
MASKCLEAR
MASKMAINTAIN 0
 
ENTLEVEL hEnt, hLev 
GETLEVELINFO hLev , $name_from_level
 
clear $$acsStandard , $$acsUser
SList  $$acsStandard
SList  $$acsUser
 
getEntityProperties hEnt, $csName , $$acsStandard , $$acsUser
 
clear nEntID
Int nEntID 
GetIDFromEnt hEnt , nEntID 
 
:scale
 
clear hEnt
HEntity hEnt
clear hInstance , nMode , nHLDisplayMethod 
HDrawInst hInstance
string $csName
int nHLDisplayMethod
Int  nMode
Int  bPHLV5
 
MASKENTITY 0, 22
MASKMAINTAIN 1
 
getent "Select Instance to read the scale", hEnt ,   , 0 , 1 ,  1 ,   , 0 , 1 , 1
if (@key == -3)
exit
if(!IsValid(hEnt))
exit
MASKCLEAR
MASKMAINTAIN 0
HEntityToHDrawInst hInstance, hEnt
 
GetDrawInstData hInstance , pos , dRotation , dWidth , dHeight , adBaseMatrix ,\
 ViewCenterPos , ViewCenterLoc , $csName , dScale ,  ,  ,  ,nMode ,   , nHLDisplayMethod
if ( dScale == 1) 
$scale= "1:1"
if ( dScale == 0.875) 
$scale= "7:8"
if ( dScale == 0.75) 
$scale= "3:4"
if ( dScale == 0.5) 
$scale= "1:2"
if ( dScale == 0.4) 
$scale= "1:2.5"
if ( dScale == 0.2) 
$scale= "1:5"
if ( dScale == 0.1) 
$scale= "1:10"
if ( dScale == 2) 
$scale= "2:1"
if ( dScale == 2.5) 
$scale= "2.5:1"
if ( dScale == 5) 
$scale= "5:1"
//if (( dScale != 1)&&( dScale !=0.875) &&( dScale != 0.75)&&( dScale != 0.5)&&( dScale != 0.4)&&( dScale != 0.2)&&( dScale != 0.1)&&\
//( dScale != 2)&&( dScale != 2.5)&&( dScale != 5))
//getstr "Manually enter the scale" , $scale ,$scale
 
CLEAR first_position
DOUBLE first_position[3]
:f_point
type_pos=0
 
GETPOS "Select the label position", type_pos, first_position 
if (@key == -3)
exit
 
x=first_position[0]
y=first_position[1]
z=first_position[2]
worldtocplane x, y, z
clear hComposite
 
CLEAR adTextAtt
DOUBLE adTextAtt[0]
ARRAY adTextAtt[13] = { 0, 5, 0.85, 0.6, 0, 0, 0, 1, 1, 0, 0, 0, 0}
CLEAR anEntAtt
INT anEntAtt[0]
ARRAY anEntAtt[8] = { 3, 0, 1, 1, 1, 0, 0, 0x0 }
 
sprint $number ,"\|405%d\|405" , nEntID
 
sprint $name , "NAME = \|403%d\|403" , nEntID
 
sprint $scale , "SCALE = %s" , $scale
 
sprint $quantity , "QUANTITY = \|413%d,QT'Y\|413" , nEntID
 
sprint $material , "MATERIAL = \|408%d\|408" , nEntID
 
sprint $treatment , "T TREAT = \|413%d,T TREAT\|413" , nEntID
 
sprint $coating , "COATING = \|413%d,COAT\|413" , nEntID
 
clear $date
string $date
sprint $date , "DATE= \|412%d\|412" , nEntID
 
CLEAR $note
string $note
sprint $note , "%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n%s", $number , $name ,$scale , $quantity , $material , $treatment , $coating , $date
 
NOTE $note , x , y-18 , 0 , , , , 0, "Smooth", adTextAtt, anEntAtt
NoteState
 
 
Int  nType = 4
MessageBox "Continue ?",  nType 
error=@error
if (error == 6)
goto start
if (error == 7)
set NoteHt , 5
if (error == 7)
exit
-------------------------------------------------------------

To return the conponente name for example, I use:
sprint $name , "NAME = \|403%d\|403" , nEntID

instead of:
sprint $name , "NAME = %s" , $$acsStandard[1]

because the first option doesn't keep the associativity.



Post attachments:
Solomon Steinberg,
Israel

DELL OPTIPLEX 7050
NVIDIA QUADRO P2000
KEYCREATOR 13.5
KEYCREATOR 2020 SP2



User avatar
Advanced member
Advanced member
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

Solomon Steinberg,
Israel

DELL OPTIPLEX 7050
NVIDIA QUADRO P2000
KEYCREATOR 13.5
KEYCREATOR 2020 SP2



User avatar
Advanced member
Advanced member
Dana - 7/31/2020 5:20:35 AM
   
RE:BOM
Soli wrote: Dana, Hello,

I have something similar.
I also use Entity Standart Properties but I use Entity User Properties to keep
Quantity, Termic Treatment and Coating for specific components,
I input Quantity manually.

For Fastner I use Entity Name instead of  Entity Standart Properties 
The program counts the quantity, automatically.

How did you solved the quantity for specific components?


Quantity is simply the number of solids selected that have the same properties, it's automatic (at least in the assembly drawing BOM).  I don't use the information in the component drawings.




1
Login