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.

ProSelect() Function

rajmohan1982

New member
Hello Sir,


I am facing Problem in ProSelect() function .. I am unable to select a Feature. Since Auxiliary Application window is in Active mode...


#include <ProToolkit.h>
#include <ProMessage.h>
#include <ProFeature.h>
#include <ProMdl.h>
#include <ProUtil.h>
#include <TestError.h>
#include <ProSelection.h>
#include <ProWchar.h>





ProError status;
ProSection section;
wchar_t wname;
int windowid;
ProFileName msgfil;
ProError err;
ProMdl model;
ProError status;
ProSelection *sel = NULL;
int n_sel;
ProModelitem item;


int user_initialize()
{


ProStringToWstring(msgfil, "selection.txt") ;

err = ProMdlCurrentGet(&model);

printf("Select a feature.");

status = ProSelect("feature", 1, NULL, NULL, NULL, NULL, &sel, &n_sel);

ProWindowRepaint(PRO_VALUE_UNUSED);



if(status == PRO_TK_NO_ERROR)
{
ProSelectionModelitemGet (sel[0], &item);


ProMessageDisplay(msgfil,"Feature Selected \n");

ProSelectionHighlight (sel[0],PRO_COLOR_HIGHLITE);

}


return 0;
}


void user_terminate()
{
printf("Terminated");

}
 
hello sir,


on the Pro Engineer main screen......click on TOOLS ----> AUXILUARY APPLICATION a small window is opened... Their i have registeredprotk.dat file. which consist of following details


NAME Only Selection dll
STARTUP dll
EXEC_FILE D:\proeWildfire 2.0\protoolkit\protk_appls\sample1\onlyselection.dll
TEXT_DIR D:\proeWildfire 2.0\protoolkit\protk_appls\sample1\onlyselection
allow_stop TRUE
REVISION Wildfire


END


when i have startedthe application Only Selection dll the AUXILUARY APPLICATION window(i.e the small window) is not closing or it is not allowing to select any feature ..... if i am selecting, Beap Sound is coming.... while selecting i.e taking the cursor on to the feature it should highlight in sky blue colour. Which is not happening......


Please solve this problem... i have been frustrated from past 2 weeks


here is my C Program


#include <ProToolkit.h>
#include <ProMessage.h>
#include <ProFeature.h>
#include <ProMdl.h>
#include <ProUtil.h>
#include <TestError.h>
#include <ProSelection.h>
#include <ProWchar.h>





ProError status;
ProSection section;
wchar_t wname;
int windowid;
ProFileName msgfil;
ProError err;
ProMdl model;
ProError status;
ProSelection *sel = NULL;
int n_sel;
ProModelitem item;


int user_initialize()
{


ProStringToWstring(msgfil, "selection.txt") ;

err = ProMdlCurrentGet(&model);

printf("Select a feature.");

status = ProSelect("feature", 1, NULL, NULL, NULL, NULL, &sel, &n_sel);

ProWindowRepaint(PRO_VALUE_UNUSED);



if(status == PRO_TK_NO_ERROR)
{
ProSelectionModelitemGet (sel[0], &item);


ProMessageDisplay(msgfil,"Feature Selected \n");

ProSelectionHighlight (sel[0],PRO_COLOR_HIGHLITE);

}


return 0;
}


void user_terminate()
{
printf("Terminated");

}


with best wishes from


Raj Mohan
 
Hi Raj,


The same problem i encountered long back.There is no solution aprat from run the application by adding some menu or button in the Pro-Engineer main window.


You need to call the ProSelect() API from the callback function of the button you added in the menu or at the main window. With out these activites you can directly select any type of entities from the window.


You can't close the Auxillary window with the code you have writtern


Just added a button code in the user_initilize() and write all your code in the callback function.


With regards


Kishore V
 
In your registry file please add one more line


delay_start true


this will allow you to start the auxilary application manually.


I guess since you didn't use this proe starts the auxilary application as soon as it starts and fails because it can not retrive model from the current window. So first load the part into the current window and then start the auxilary application.Althougha better solution is to create a menu push button you can also try by using delay_start true.





NAME Only Selection dll
STARTUP dll
EXEC_FILE D:\proeWildfire 2.0\protoolkit\protk_appls\sample1\onlyselection.dll
TEXT_DIR D:\proeWildfire 2.0\protoolkit\protk_appls\sample1\onlyselection
allow_stop TRUE


delay_start TRUE
REVISION Wildfire


END
 

Sponsor

Back
Top