Kubotek Forum

KeyCreator CAD & CKD Viewer Technical discussion of CAD/CAM and integrated partner products
Subscribe to post
User avatar
Soli - (2/8/2023 1:24:41 PM)
RE:BOM with solids contained in Internal References
Wes, Hello,
I hope you will find the solution to solve my problem.

My customer asks, additional to assembly drawings, to give him pictures
with the number and the name of components.
Till now I can't do this if the components belong to an internal reference part.
I found that the KXL function GetEnt can access the entities in the reference
part if bSelRefEnts = 1.
Here is the macro to create a Label in the assembly file and to find the Entity name
($csName) of components in the reference part.
--------------------------------------------------------------------------------------
:start
 
clear hEnt
HENTITY hEnt
 
MASKINVERSE 0
MASKENTITY 0, 32 ,34 ,35 ,36
 
int nSelFlag = 0
Int  nSelParent = 1
Int  bSelRefEnts = 1
Int  bAccept = 1
bActiveInstFlag = 1
GetEnt "Select standard component", hEnt,  , nSelFlag, nSelParent, bSelRefEnts,  , bAccept, bActiveInstFlag 
 
if (@key == -3)
MASKCLEAR
if (@key == -3)
MASKMAINTAIN 0
if (@key == -3)
EXIT
 
clear $$acsStandard , $$acsUser , $standard_name
SList  $$acsStandard
SList  $$acsUser
string $csName
 
GetEntityProperties hEnt , $csName , $$acsStandard , $$acsUser
notestate
 
// Begin Macro Record
// This Macro is intended to be a Macro Script
 
MASKCLEAR
 
// (0xA1C6) Create a label
Clear arrow_loc
HLocation arrow_loc
CLEAR  dLocX1, dLocY1, dLocZ1
DOUBLE dLocX1, dLocY1, dLocZ1
 
//arrow_point
GETPOS "Select the arrow position", 0 , arrow_loc
if (@key == -3)
exit
LOCATIONCOORD arrow_loc, dLocX1, dLocY1, dLocZ1
worldtocplane dLocX1, dLocY1, dLocZ1
//balon point
Clear hTextLoc
HLocation hTextLoc
CLEAR  dLocX2, dLocY2, dLocZ2
DOUBLE dLocX2, dLocY2, dLocZ2
 
GETPOS "Select the Label position", 0 , hTextLoc
if (@key == -3)
exit
LOCATIONCOORD hTextLoc, dLocX2, dLocY2, dLocZ2
worldtocplane dLocX2, dLocY2, dLocZ2
 
CLEAR hLabel
HENTITY hLabel
LABEL $csName, 2  ,   ,   ,   ,   ,   , hTextLoc
notestate
LASTENT hLabel
if(!IsValid(hLabel))
exit
 
ADDLABELLDR hLabel, , , , , arrow_loc
notestate
MASKCLEAR
MASKMAINTAIN 0
goto start
-----------------------------------------------------------------------------------------

In the attached picture, all components belong to an internal reference.
The labels shown the Entity name of the components


 
Login