Creo二次开发--函数--基准坐标系
访问基准坐标系
ProCsys代表了基准坐标系,以下三个函数对基准坐标系的操作。
ProSolidCsysVisit() --遍历实体中的基准坐标系
ProCsysIdGet() --获取指定坐标系的标识符,用于以后在此坐标系中生成几何元素。
ProCsysInit() --由指定的Id值获取坐标系的句柄
/*=========================================================================*\
Function: ProUtilCollectSolidCsys()
Purpose: 返回实体的坐标系集合
Returns: PRO_TK_NO_ERROR - 成功;
PRO_TK_BAD_INPUTS - 无效的参数
转载请注明出处:http://blog.csdn.net/jh2005
\*=========================================================================*/
ProError ProUtilCollectSolidCsys(
ProSolid p_solid,
/* In: 实体的句柄*/
ProCsys **p_csys
/* Out: 基准坐标系的返回值,本函数进行了内存分配,
但是没有回收,必须用ProArrayFree()
进行内存回收。*/
)
{
ProError status;
if( p_csys != NULL )
{
status = ProArrayAlloc( 0, sizeof(ProCsys), 1, (ProArray*)p_csys );
if( status == PRO_TK_NO_ERROR )
{
status = ProSolidCsysVisit( p_solid,
(ProCsysVisitAction)ProUtilCollect3ParamOpaqueVisitAction,
(ProCsysFilterAction)ProUtilDefaultFilter,
(ProAppData)&p_csys );
if( status != PRO_TK_NO_ERROR )
{
ProArrayFree( (ProArray*)p_csys );
*p_csys = NULL;
}
}
}
else
status = PRO_TK_BAD_INPUTS;
return (status);
}
ProError ProUtilCollect2ParamDBVisitAction(
void *p_object,
/* In: The pointer to the object
being visited */
ProAppData app_data)
/* In: In fact it's ProArray** */
{
ProError status;
ProArray *p_array;
p_array = (ProArray*)((void**)app_data)[0];
status = ProArrayObjectAdd(p_array, PRO_VALUE_UNUSED, 1, p_object );
return (status);
}
ProError ProUtilCollect3ParamOpaqueVisitAction(
void *p_object, www.zzzyk.com
/* In: The opaque handle being visited */
ProError status,
/* In: The status returned by filter func */
ProAppData app_data)
/* In: In fact it's ProArray** */
{
return (ProUtilCollect2ParamDBVisitAction((void*)&p_object, app_data));
}
ProError ProUtilDefaultFilter()
{
return (PRO_TK_NO_ERROR);
}
补充:综合编程 , 其他综合 ,