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.

Register Log in

why isn't ProDimensionTextGet() used?

api303

New member
int UserGetDimensionText()

{

ProError err;

ProSelection *sel=NULL;

ProDimension dim;

ProSolid solid=NULL;

int type,dim_type;

ProLine *p_text = NULL;



int n_sel;

int dim_id;

char temtem[50];

int n_text;

ProCharLine line;

ProMdl model;

err=ProMdlCurrentGet(&model);//pz 2.27

if(err!=PRO_TK_NO_ERROR) printf(model is NULL! \n);



ProArrayAlloc(0, sizeof(ProLine), 1, (ProArray*)&p_text);

printf(hanshuA has called!\n);



ProUtilMsgPrint (gen, TEST %0s, Select dimension: );

printf(hanshuB has called!\n);

err = ProSelect(dimension,ref_dim, 1, NULL, NULL, NULL, NULL,

&sel, &n_sel);

printf(hanshuC has called!\n);



if( (err != PRO_TK_NO_ERROR) || (n_sel < 1) )

return -1;



err = ProSelectionModelitemGet (sel[0], &dim);

if(err!=PRO_TK_NO_ERROR) printf(selection is NULL! );



dim_id=dim.id;

//dim_type=dim.type;

err = ProDimensionTypeGet (&dim, &type);

if(err!=PRO_TK_NO_ERROR) printf(ProDimensionTypeGet is NULL! );

dim_type=type;

//dim_type=PRO_DIM_PARAM || PRO_REFDIM_PARAM ;

printf(dim_id value is : %d\n,dim_id);

printf(dim_type value is : %d\n,dim_type);



err = ProDimensionTextGet (&dim, &p_text);

TEST_CALL_REPORT(ProDimensionTextGet(),

ProTestDimensionMenu(), err, err != PRO_TK_NO_ERROR

&& err != PRO_TK_E_NOT_FOUND);



if (err == PRO_TK_NO_ERROR && p_text != NULL)

{

err = ProArraySizeGet ((ProArray)p_text, &n_text);

printf(n_text=%d\n,n_text);

if (err == PRO_TK_NO_ERROR && n_text)

{

printf( Dimension text:\n);

for (i = 0; i < n_text; i++)

ProWstringToString (line, p_text);

printf (line= %s, line);

}

}

ProArrayFree ((ProArray*)&p_text);

return(1);

}





hanshuA has called!

hanshuB has called!

hanshuC has called!

dim_id value is : 1576

dim_type value is : 9

n_text=-1
 

Sponsor

Top