方法1:偏移原始坐标系创建新坐标系
方法2:在中点创建基准点/面,之后创建坐标系
采用方法:方法2
步骤:
选择边-添加点-添加坐标系
创建方法:点 -边-边
1.1 选择边特征
status = ProSelect("edge", 1, NULL, NULL, NULL, NULL, &sel_1, &nSel)<pre name="code" class="cpp"> status = ProSelectionCopy(*sel_1, &sel_11); //复制一份,防范而已
1.2创建一个基准点,使用方法 元素树 详情参考 ProDtmPnt.h (可以搜索 ProElementAlloc)
setPoint()
{
//ProSelectionModelitemGet(*sel_1, &item);
//元素树
ProElement elem_tree, elem_type, elem_dpo_type, elem_array, elem_point;
ProElement elem_pla_cons, elem_pla_con, elem_pla_ref, elem_pla_type;
ProElement elem_dim_cons, elem_dim_con, elem_dim_ref, elem_dim_type, elem_dim_val;
{ status = ProElementAlloc(PRO_E_FEATURE_TREE, &elem_tree); //创建元素树根
if (status != PRO_TK_NO_ERROR) { return status; }
int ivalue = PRO_FEAT_DATUM_POINT;
//添加类型 创建一个点
UsrElemtreeElementAdd(PRO_E_FEATURE_TYPE, elem_tree, &ivalue, PRO_VALUE_TYPE_INT, &elem_type);
//添加点类型
ivalue = PRO_DPOINT_TYPE_GENERAL;
UsrElemtreeElementAdd(PRO_E_DPOINT_TYPE, elem_tree, &ivalue, PRO_VALUE_TYPE_INT, &elem_dpo_type);
//参照数组
status = ProElementAlloc(PRO_E_DPOINT_POINTS_ARRAY, &elem_array);
status = ProElemtreeElementAdd(elem_tree, NULL, elem_array);
//点
status = ProElementAlloc(PRO_E_DPOINT_POINT, &elem_point);
status = ProElemtreeElementAdd(elem_array, NULL, elem_point);
//pla cons
status = ProElementAlloc(PRO_E_DPOINT_PLA_CONSTRAINTS, &elem_pla_cons);
status = ProElemtreeElementAdd(elem_point, NULL, elem_pla_cons);
//pla con
status = ProElementAlloc(PRO_E_DPOINT_PLA_CONSTRAINT, &elem_pla_con);
status = ProElemtreeElementAdd(elem_pla_cons, NULL, elem_pla_con);
//pla ref sel_1
UsrElemtreeElementAdd(PRO_E_DPOINT_PLA_CONSTR_REF, elem_pla_con, sel_1, PRO_VALUE_TYPE_SELECTION, &elem_