cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Select Surfaces from extrude

aboujaoub
1-Newbie

Select Surfaces from extrude

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


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2

hello friend ,

extrude is a feature ,not solid

so you should use ProFeatureGeomitemVisit function.

Regards

Ajoy Mathew