📄 utilcollect.c
字号:
return (status);}/*=========================================================================*\ Function: ProUtilCollectSolidFeatures() Purpose: Return a list of features in the solid Returns: PRO_TK_NO_ERROR - success; PRO_TK_BAD_INPUTS - invalid parameters\*=========================================================================*/ProError ProUtilCollectSolidFeatures( ProSolid p_solid, /* In: The solid handle */ ProFeature **p_features /* Out: ProArray with collected features items. The function allocates memory for this argument, but you must free it. To free the memory, call the function ProArrayFree() */){ ProError status; status = ProUtilCollectSolidFeaturesWithFilter (p_solid, (ProFeatureFilterAction)ProUtilDefaultFilter, p_features); return (status);}/*=========================================================================*\ Function: ProUtilCollectNCSeqFeat() Purpose: Return a list of NCSeq in the mfg Returns: PRO_TK_NO_ERROR - success; PRO_TK_BAD_INPUTS - invalid parameters\*=========================================================================*/ProError ProUtilCollectNCSeqFeat( ProSolid p_solid, /* In: The solid handle */ ProFeature **p_features /* Out: ProArray with collected features items. The function allocates memory for this argument, but you must free it. To free the memory, call the function ProArrayFree() */){ ProError status; status = ProUtilCollectSolidFeaturesWithFilter (p_solid, ProUtilCollectNCSeqFeatFilter, p_features); return (status);}/*=========================================================================*\ Function: ProUtilCollectDtmCurveFeat() Purpose: Return a list of features in the solid Returns: PRO_TK_NO_ERROR - success; PRO_TK_BAD_INPUTS - invalid parameters\*=========================================================================*/ProError ProUtilCollectDtmCurveFeat( ProSolid p_solid, /* In: The solid handle */ ProFeature **p_features /* Out: ProArray with collected features items. The function allocates memory for this argument, but you must free it. To free the memory, call the function ProArrayFree() */){ ProError status; status = ProUtilCollectSolidFeaturesWithFilter (p_solid, (ProFeatureFilterAction)ProUtilCollectDtmCurveFeatFilter, p_features); return (status);}/*=========================================================================*\ Function: ProUtilCollectSolidFeatvis() Purpose: Return a list of visible features in the solid Returns: PRO_TK_NO_ERROR - success; PRO_TK_BAD_INPUTS - invalid parameters\*=========================================================================*/ProError ProUtilCollectSolidFeatvis( ProSolid p_solid, /* In: The solid handle */ ProFeature **p_features /* Out: ProArray with collected features items. The function allocates memory for this argument, but you must free it. To free the memory, call the function ProArrayFree() */){ ProError status; status = ProUtilCollectSolidFeaturesWithFilter (p_solid, ProUtilFeatvisFilterAction, p_features); return (status);}/*=========================================================================*\ Function: ProUtilCollectAsmcomp() Purpose: Return a list of assembly components in the assembly Returns: PRO_TK_NO_ERROR - success; PRO_TK_BAD_INPUTS - invalid parameters\*=========================================================================*/ProError ProUtilCollectAsmcomp( ProAssembly p_assy, /* In: The assembly handle */ ProAsmcomp **p_asmcomps /* Out: ProArray with collected asm comps. The function allocates memory for this argument, but you must free it. To free the memory, call the function ProArrayFree() */){ ProError status; status = ProUtilCollectSolidFeaturesWithFilter (p_assy, ProUtilAsmcompFilterAction, p_asmcomps); return (status);}/*=========================================================================*\ Function: ProUtilCollectSurfaceContours() Purpose: Return a list of contours which belong to the surface Returns: PRO_TK_NO_ERROR - success; PRO_TK_BAD_INPUTS - invalid parameters\*=========================================================================*/ProError ProUtilCollectSurfaceContours( ProSurface p_surfaces, /* In: The handle to the quilt */ ProContour **p_contours /* Out: ProArray with collected contours. The function allocates memory for this argument, but you must free it. To free the memory, call the function ProArrayFree()*/){ ProError status; if( p_contours != NULL ) { status = ProArrayAlloc( 0, sizeof(ProContour), 1, (ProArray*)p_contours ); TEST_CALL_REPORT("ProArrayAlloc()", "ProUtilCollectSurfaceContours()", status, status != PRO_TK_NO_ERROR); if( status == PRO_TK_NO_ERROR ) { ACTION_TYPE( "ProSurfaceContourVisitAction", "ProSurfaceContourFilterAction" ) status = ProSurfaceContourVisit( p_surfaces, (ProSurfaceContourVisitAction)ProUtilCollect3ParamOpaqueVisitAction, (ProSurfaceContourFilterAction)ProUtilDefaultFilter, (ProAppData)&p_contours ); TEST_CALL_REPORT("ProSurfaceContourVisit()", "ProUtilCollectSurfaceContours()", status, status != PRO_TK_NO_ERROR && status != PRO_TK_E_NOT_FOUND); if( status != PRO_TK_NO_ERROR ) { ProArrayFree( (ProArray*)p_contours ); *p_contours = NULL; } } } else status = PRO_TK_BAD_INPUTS; return (status);}/*=========================================================================*\ Function: ProUtilCollectMdlLayers() Purpose: Return a list of layers in the solid Returns: PRO_TK_NO_ERROR - success; PRO_TK_BAD_INPUTS - invalid parameters\*=========================================================================*/ProError ProUtilCollectMdlLayers( ProMdl model, /* In: The model handle */ ProLayer **p_layers /* Out: ProArray with collected layers. The function allocates memory for this argument, but you must free it. To free the memory, call the function ProArrayFree() */){ ProError status; if( p_layers != NULL ) { status = ProArrayAlloc(0,sizeof(ProLayer), 1, (ProArray*)p_layers); TEST_CALL_REPORT("ProArrayAlloc()", "ProUtilCollectMdlLayers()", status, status != PRO_TK_NO_ERROR); if( status == PRO_TK_NO_ERROR ) { ACTION_TYPE( "ProLayerAction", "ProLayerAction" ) status = ProMdlLayerVisit( model, (ProLayerAction)ProUtilCollect2ParamDBVisitAction, (ProLayerAction)ProUtilDefaultFilter, (ProAppData)&p_layers ); TEST_CALL_REPORT("ProMdlLayerVisit()", "ProUtilCollectSolidMdlLayers()", status, status != PRO_TK_NO_ERROR && status != PRO_TK_E_NOT_FOUND); if( status != PRO_TK_NO_ERROR ) { ProArrayFree( (ProArray*)p_layers ); *p_layers = NULL; } } } else status = PRO_TK_BAD_INPUTS; return (status);}/*=========================================================================*\ Function: ProUtilCollectDimensions() Purpose: Return a list of dimensions in the part, assembly, or drawing Returns: PRO_TK_NO_ERROR - success; PRO_TK_BAD_INPUTS - invalid parameters\*=========================================================================*/ProError ProUtilCollectDimension( ProMdl model, /* In: The handle to the model */ int user_type, /* In: The dimension type PRO_DIM_PARAM - for regular dimensions PRO_REFDIM_PARM - for reference dims */ int filter, /* In: A dimension type filter as in function prodim_get_dim_ids() */ int **p_dims /* Out: ProArray with collected dimensions. The function allocates memory for this argument, but you must free it. To free the memory, call the function ProArrayFree()*/){ int *dims, n; ProError status; n = prodim_get_dim_ids((Prohandle)model, user_type, filter, &dims); if (n==0) { status = PRO_TK_E_NOT_FOUND; } else if (n>0) { status = ProArrayAlloc( 0, sizeof(int), 1, (ProArray*)p_dims); TEST_CALL_REPORT("ProArrayAlloc()", "ProUtilCollectDimensions", status, status != PRO_TK_NO_ERROR); if( status == PRO_TK_NO_ERROR ) { status = ProArrayObjectAdd( (ProArray*)p_dims, PRO_VALUE_UNUSED, n, dims ); } } else status = PRO_TK_GENERAL_ERROR; return (status);}/*=========================================================================*\ Function: ProUtilFindFeatureByName() Purpose: Return a feature with specified name Returns: PRO_TK_NO_ERROR - success; PRO_TK_E_NOT_FOUND - no valid feature found\*=========================================================================*/ProError ProUtilFindFeatureByName( ProSolid p_solid, /* In : The solid */ ProName name, /* In : The feature name */ ProFeature *p_feature) /* Out: Founded feature,user's memory */{ FindByName find; ProError status; find.p_modelitem = (ProModelitem*)p_feature; find.name = name; ACTION_TYPE( "ProFeatureVisitAction", "ProFeatureFilterAction" ) status = ProSolidFeatVisit( (ProSolid)p_solid, (ProFeatureVisitAction)ProUtilFindModelitemVisitAction, (ProFeatureFilterAction)ProUtilByNameFilterAction, (ProAppData)&find); TEST_CALL_REPORT("ProSolidFeatVisit()", "ProUtilFindFeatureByName()", status, status != PRO_TK_NO_ERROR && status != PRO_TK_E_NOT_FOUND);/*----------------------------------------------------------------*\ if feature founded set status to PRO_TK_NO_ERROR\*----------------------------------------------------------------*/ if (status == PRO_TK_USER_ABORT) status = PRO_TK_NO_ERROR; return (status);}/*=========================================================================*\ Function: ProUtilFindFeatvisByName() Purpose: Return a visible feature with specified name Returns: PRO_TK_NO_ERROR - success; PRO_TK_E_NOT_FOUND - no valid feature found\*=========================================================================*/ProError ProUtilFindFeatvisByName( ProSolid p_solid, /* In : The solid */ ProName name, /* In : The feature name */ ProFeature *p_feature) /* Out: Founded feature,user's memory */{ FindByName find; ProError status; find.p_modelitem = (ProModelitem*)p_feature; find.name = name; ACTION_TYPE( "ProFeatureVisitAction", "ProFeatureFilterAction" ) status = ProSolidFeatVisit( (ProSolid)p_solid, (ProFeatureVisitAction)ProUtilFindModelitemVisitAction, (ProFeatureFilterAction)ProUtilFeatvisByNameFilterAction, (ProAppData)&find); TEST_CALL_REPORT("ProSolidFeatVisit()", "ProUtilFindFeatvisByName()", status, status != PRO_TK_NO_ERROR && status != PRO_TK_E_NOT_FOUND);/*----------------------------------------------------------------*\ if feature founded set status to PRO_TK_NO_ERROR\*----------------------------------------------------------------*/ if (status == PRO_TK_USER_ABORT) status = PRO_TK_NO_ERROR; return (status);}/*=========================================================================*\ Function: ProUtilFindFeatureGeomitemByName() Purpose: Return a geomitem with specified name Returns: PRO_TK_NO_ERROR - success; PRO_TK_E_NOT_FOUND - no valid feature found\*=========================================================================*/ProError ProUtilFindFeatureGeomitemByName( ProFeature *p_feature, /* In: The feature handle */ ProType item_type, /* In: The type of expected geometry item */ ProName name, /* In : The name */ ProGeomitem *p_geomitem) /* Out: The geomitem (user's memory) */{ FindByName find; ProError status; find.p_modelitem = (ProModelitem*)p_geomitem; find.name = name; ACTION_TYPE( "ProGeomitemAction", "ProGeomitemFilter" ) status = ProFeatureGeomitemVisit( p_feature, item_type, (ProGeomitemAction)ProUtilFindModelitemVisitAction, (ProGeomitemFilter)ProUtilByNameFilterAction, (ProAppData)&find);/*----------------------------------------------------------------*\ if geomitem is founded set status to PRO_TK_NO_ERROR\*----------------------------------------------------------------*/ if (status == PRO_TK_USER_ABORT) status = PRO_TK_NO_ERROR; return (status);}/*=========================================================================*\ Function: ProUtilCollectSolidAxisByVector() Purpose: Return a list of axis which belong to the solid and parallel (perpendicular) to a vector Returns: PRO_TK_NO_ERROR - success; PRO_TK_BAD_INPUTS - invalid parameters\*====================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -