typedef struct user_appdata
{
FILE *fp;
int level;
} UserAppdata;
/*----------------------------------------------------------------*\
Function prototypes
\*----------------------------------------------------------------*/
int UserAsmCompVisit (void *dummy, int dummy2);
ProError UserAsmCompFilter (ProFeature *feature, ProAppData app_data);
ProError user_action (ProFeature *feature, ProError status,
 roAppData appdata);
/*================================================================*\
Function to write out the members of the current assembly, and
display the result in an information window.
\*================================================================*/
int UserAsmCompVisit (void *dummy, int dummy2)
{
 roMdl asm;
char name[PRO_NAME_SIZE];
char type[PRO_TYPE_SIZE];
wchar_t wname[PRO_NAME_SIZE];
 roMdldata mdldata;
ProError err;
UserAppdata appdata;
FILE *fp;
ProMdlCurrentGet ([$asm)]
/*----------------------------------------------------------------*\
Open the text file.
\*----------------------------------------------------------------*/
strcpy (name,FILENAME);
fp = fopen (name,"w");
ProMdlDataGet (asm, [$mdldata)]
ProWstringToString (name, mdldata.name);
ProWstringToString (type, mdldata.type);
fprintf (fp, "%s %s\n",name,type);
appdata.fp = fp;
appdata.level = 1;
/*----------------------------------------------------------------*\
List the assembly members.
\*----------------------------------------------------------------*/
// ProSolidFeatVisit (asm, user_action, UserAsmCompFilter, [$appdata)]
/*----------------------------------------------------------------*\
Close the file and display it.
\*----------------------------------------------------------------*/
fclose (fp);
ProStringToWstring (wname, FILENAME);
ProInfoWindowDisplay (wname, NULL, NULL);
return (PRO_TK_NO_ERROR);
}
/*================================================================*\
FUNCTION: UserAsmCompFilter()
PURPOSE: A filter used by ProSolidFeatVisit() to visit
features that are assembly components
\*================================================================*/
ProError UserAsmCompFilter (
ProFeature *feature,
ProAppData app_data)
{
ProError status;
ProFeattype ftype;
/*----------------------------------------------------------------*\
Get the feature type
\*----------------------------------------------------------------*/
status = ProFeatureTypeGet (feature, [$ftype)]
/*----------------------------------------------------------------*\
If the feature is an assembly component,
return NO ERROR,
else
return CONTINUE
\*----------------------------------------------------------------*/
if (ftype == PRO_FEAT_COMPONENT)
return (PRO_TK_NO_ERROR);
return (PRO_TK_CONTINUE);
}
/*-----------------------------------------------------------------*\
Write the information to a file.
\*-----------------------------------------------------------------*/
ProError user_action (
ProFeature *feature,
ProError status,
ProAppData appdata)
{
FILE *fp;
int l, level;
ProError err;
ProMdl mdl;
char name[PRO_NAME_SIZE];
char type[PRO_TYPE_SIZE];
wchar_t wname[PRO_NAME_SIZE];
UserAppdata *appd, appd1;
ProMdldata mdldata;