Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Difference betn two functions

Sanjay Meher

New member
hi


I am going through the utility functions available and have come across the following difficulty in UtliVisit.c


I can't understand the difference between the following two functions


/*========================================================== ==========*\
FUNCTION :proUtilAsmTraverse()
PURPOSE :Visit function for components of an assembly at ALL levels
\*========================================================== ==========*/
ProError ProUtilAsmTraverse(
ProAssembly assembly,
ProFunction action,
ProAppData app_data)
{
ProError status;
AsmTrav_data_t asm_data;
ProIdTable comp_id_table;


/*---------------------------------------------------------- ----------*\
Initialize our asm_data
\*---------------------------------------------------------- ----------*/
asm_data.app_data = app_data;
asm_data.action = (ProTestAsmTravAction)action;
comp_id_table[0] = -1;
status = ProAsmcomppathInit(assembly, comp_id_table, 0,
&asm_data.comp_path);
TEST_CALL_REPORT("ProAsmcomppathInit()", "ProUtilAsmTraverse()",
status, status != PRO_TK_NO_ERROR);


/*---------------------------------------------------------- ----------*\
Visit the components are this level
\*---------------------------------------------------------- ----------*/
ProUtilAsmcompVisit(assembly, (ProFunction)ProUtilAsmTravAction,
(ProAppData)&asm_dat a);


return(PRO_TK_NO_ERROR);
}








/*========================================================== ==========*\
FUNCTION : ProUtilAsmFeatsTraverse()
PURPOSE : Visit function for features of an assembly at *ALL* levels
\*========================================================== ==========*/
ProError ProUtilAsmFeatsTraverse(
ProAssembly assembly,
ProFunction action,
ProAppData app_data)
{
ProError status;
AsmTrav_data_t asm_data;
ProIdTable comp_id_table;

/*---------------------------------------------------------- ----------*\
Initialize our asm_data
\*---------------------------------------------------------- ----------*/
asm_data.app_data = app_data;
asm_data.action = (ProTestAsmTravAction) action;
comp_id_table[0] = -1;
status = ProAsmcomppathInit(assembly, comp_id_table, 0,
&asm_data.comp_path);
TEST_CALL_REPORT("ProAsmcomppathInit()", "ProUtilAsmTraverse()",
status, status != PRO_TK_NO_ERROR);

/*---------------------------------------------------------- ----------*\
Visit the components are this level
\*---------------------------------------------------------- ----------*/
ProUtilAsmcompVisit(assembly, (ProFunction) ProUtilAsmTravAction,
(ProAppData)&asm_data);

return(PRO_TK_NO_ERROR);
}






Though in the comments they have mentioned their usage. However the code of both the function are exactly the same. Can any one tell me where tje dofference is in both the function.


If not then what is missing that has to be corrected in either of the function.


Thanks
Sanjay Meher
 
There is none. probably they use it once to collect all components in an assembly and second to collect all the features in an assembly. As you know the ProAsmCompVisit can be used for both, components and features. You only need a filter.


I tried to use their function to createthe assemblytree and I did't like it. I made my own routine based on the same ProAsmcomppathInit function.


Good luck!


-Hora
 

Sponsor

Back
Top