|
想创建2个面之间的距离但怎么都会报PRO_TK_BAD_INPUTS的错误,大佬能帮忙看看问题出在哪吗
ProName filemsg;
ProError status;
ProSelection* sel, * sel_plane;
ProDimAttachment *attachment_sel;
int n_sels = 0,n_plane;
int window_id;
int size = 0;
status = ProArrayAlloc(2, sizeof(ProDimAttachment), 1, (ProArray*)&attachment_sel);
if (status != PRO_TK_NO_ERROR)
return false;
//选取面
status = ProSelect((char*)"pntsrf", 2, NULL, NULL, NULL, NULL, &sel, &n_sels);
status = ProSelectionCopy(sel[0],attachment_sel[0]);
status = ProSelectionCopy(sel[1],attachment_sel[1]);
if (status != PRO_TK_NO_ERROR)
return false;
//选取dimsense
MYFChooseDimSense();
//注释平面获取
ProView p_view=nullptr;
status = AnnotationBase::MYFAnnotationPlaneGet(m_model, TOP, p_view, &m_ap);
if (status != PRO_TK_NO_ERROR)
return false;
//标注点
ProMousePickGet(PRO_LEFT_BUTTON, &m_buttion_press, m_dimLoaction);
ProMatrix view_matrix, view_matrix_inv;
ProPoint3d model_point;
status = ProViewMatrixGet(m_model, p_view, view_matrix);
ProUtilMatrixInvert(view_matrix, view_matrix_inv);
status = ProPntTrfEval(m_dimLoaction, view_matrix_inv, model_point);
status = ProDimensionCreate((ProSolid)m_model, PRO_DIMENSION, &m_ap, attachment_sel, m_Dimdense, PRO_DIM_ORNT_SLANTED, model_point, &m_dimension); //PRO_TK_BAD_INPUTS |
|