Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi All,
Is there anyone know witch function we need toselectorcollect all surfaces on an EXTRUDE, I've doneon solid (it's ok), I got all surfaces found on solid, but it doesn't work for an extrude.
Is there other technics or suggestion???
thanks in advance.
Here's the code (works only for solid)
*/*/*/*/*/*/*/*/
#include <protoolkit.h>
#include "ProMenu.h"
#include "ProMenuBar.h"
#include "ProUtil.h"
#include "ProSolid.h"
#include <prouimessage.h>
/* Globals */
FILE *logfile;
ProError err_ray;
/* Prototypes */
void print( char* name);
void toolkit_issue ();
/* macros */
#define ERR(api) { err_ray = api;if(err_ray != PRO_TK_NO_ERROR) { \
fprintf(logfile,"\n");\
fprintf(logfile,#api " Error = %d in File:<%s> Line <%d>)",\
err_ray, __FILE__,__LINE__); fflush(logfile);return;}}
/*************************************************************************/
int tk_issue (ProAppData arg_1, int arg_2)
{
toolkit_issue ();
return(0);
}
int user_initialize()
{
ProError err;
uiCmdCmdId cmd_id;
logfile = fopen("log.txt", "w");
fprintf(logfile, "Log started.");
fprintf(logfile, "\n=============\n");
fflush(logfile);
err=ProCmdActionAdd("Toolkit_Issue", (uiCmdCmdActFn) tk_issue, uiProe2ndImmediate,
NULL, PRO_B_TRUE, PRO_B_TRUE, &cmd_id);
err=ProMenubarMenuAdd("Toolkit Menu", "Toolkit Menu", "Help", PRO_B_TRUE, L"message.txt");
err=ProMenubarmenuPushbuttonAdd("Toolkit Menu", "Toolkit Button", "Toolkit Button", "Toolkit Button",
NULL, PRO_B_TRUE, cmd_id, L"message.txt");
return (0);
}
void user_terminate()
{
fprintf(logfile, "\n\n================================================\n");
fprintf(logfile, "Pro/TOOLKIT application terminated successfully.");
fprintf(logfile, "\n================================================\n");
fflush(logfile);
fclose(logfile);
}
void print( char* name)
{
fprintf(logfile, "\n%s", name);
fflush(logfile);
}
void wprint(ProName wname )
{
char name[256];
print(ProWstringToString(name,wname));
}
/*====================================================================*\
FUNCTION : DisplayMsg()
PURPOSE : Display a message
\*====================================================================*/
void DisplayMsg(ProLine messageTitle, ProPath messageError)
{
ProUIMessageButton* buttons;
ProUIMessageButton user_choice;
/*--------------------------------------------------------------------*\
Setup array of choices to display in the popup dialog.
\*--------------------------------------------------------------------*/
ProError status = ProArrayAlloc(1, sizeof(ProUIMessageButton), 1, (ProArray*)&buttons);
if(status!=PRO_TK_NO_ERROR) {
return;
}
buttons [0] = PRO_UI_MESSAGE_YES;
ProUIMessageDialogDisplay(PROUIMESSAGE_INFO, messageTitle, messageError,
buttons, PRO_UI_MESSAGE_YES, &user_choice);
ProArrayFree((ProArray*)&buttons);
}
/*=====================================================================*\
FUNCTION: VisitSurfaces
PURPOSE: Visit all the surfaces of a solid
\*=====================================================================*/
ProError VisitSurfaces(ProSurface p_surface, ProError err, ProAppData aData)
{
DisplayMsg(L"Visit Surface", L"At least a surface has been found!");
return PRO_TK_NO_ERROR;
}
/*************************************************************************/
/******** ISSUE RELATED Programming Code bellow ************/
/*************************************************************************/
void toolkit_issue ()
{
ProError status;
ProMdl mdl;
status = ProMdlCurrentGet(&mdl);
status = ProSolidSurfaceVisit( mdl, (ProSurfaceVisitAction)VisitSurfaces, NULL, NULL);
if(status==PRO_TK_E_NOT_FOUND) {
DisplayMsg(L"Visit Surface", L"No surface has been found!");
}
return;
}
*/*/*/*/*/*/*/*/
*/*/*/*/*/*/*/*/Anouar B.
Developpement Engineer
hello friend ,
extrude is a feature ,not solid
so you should use ProFeatureGeomitemVisit function.
Regards
Ajoy Mathew