ProE_toolkit
New member
I'm trying to call this function in my TOOLKIT program so that I can compute the local interference between two parts.
When the program run it seems to crash when it hits the 'status = pro_compute_interference(sel, 0, intf_surfs, n_surfs)'.
How does one properly call 'pro_compute_interference'? I used <ProE install>/protoolkit/protkdoc/samples/UgGeomInterferCheck_ c for reference.
Here is the relevant part of mycode:
#include "pro_interf.h"
ProError user_part_interference ()
{
int status;
Select3d *sel;
Prohandle *intf_surfs, i;
int n_surfs;
fprintf (logfile, "ProError sel d: %d \t\n",sel);
status = pro_compute_interference(sel, 0, intf_surfs, n_surfs);print_status("pro_compute_interference");
return (PRO_TK_NO_ERROR);
}
Backround from the api:
Function pro_compute_interference
Description
Measures the interference between the two specified parts. This function returns a list of surface handles that represent the total volume of interference between two parts. This data does not change upon regeneration, file management erase, and so on.
Note that the function does not reallocate theinterf_volume_surfsarray each time. To free the volume, use thepro_interference_volume_release()function.
Synopsis
#include <pro_interf.h>
int
pro_compute_interference
(
Select3dsel_recs[2]
/* (In)
The two parts whose interference you want to check (sel_type == SEL_3D_PART).
*/
Pro_interf_typeinterference_type
/* (In)
The interference type.
*/
Prohandle**interference_surf_arr
/* (Out)
The total volume of interference. This is an array of surface handles, or NULL if there is no interference. The surfaces returned are in the coordinates of the top-level assembly.
*/
int*n_surfs
/* (Out)
The number of surfaces in the volume.
*/
)
Returns
Success
PRODEV_NO_ERROR
Error
An appropriate error constant fromprodev_error.h
When the program run it seems to crash when it hits the 'status = pro_compute_interference(sel, 0, intf_surfs, n_surfs)'.
How does one properly call 'pro_compute_interference'? I used <ProE install>/protoolkit/protkdoc/samples/UgGeomInterferCheck_ c for reference.
Here is the relevant part of mycode:
#include "pro_interf.h"
ProError user_part_interference ()
{
int status;
Select3d *sel;
Prohandle *intf_surfs, i;
int n_surfs;
fprintf (logfile, "ProError sel d: %d \t\n",sel);
status = pro_compute_interference(sel, 0, intf_surfs, n_surfs);print_status("pro_compute_interference");
return (PRO_TK_NO_ERROR);
}
Backround from the api:
Function pro_compute_interference
Description
Measures the interference between the two specified parts. This function returns a list of surface handles that represent the total volume of interference between two parts. This data does not change upon regeneration, file management erase, and so on.
Note that the function does not reallocate theinterf_volume_surfsarray each time. To free the volume, use thepro_interference_volume_release()function.
Synopsis
#include <pro_interf.h>
int
pro_compute_interference
(
Select3dsel_recs[2]
/* (In)
The two parts whose interference you want to check (sel_type == SEL_3D_PART).
*/
Pro_interf_typeinterference_type
/* (In)
The interference type.
*/
Prohandle**interference_surf_arr
/* (Out)
The total volume of interference. This is an array of surface handles, or NULL if there is no interference. The surfaces returned are in the coordinates of the top-level assembly.
*/
int*n_surfs
/* (Out)
The number of surfaces in the volume.
*/
)
Returns
Success
PRODEV_NO_ERROR
Error
An appropriate error constant fromprodev_error.h