|  | 
 
 楼主|
发表于 2019-4-24 20:54
|
显示全部楼层 
| 您好,ProDimensionAttachmentsGet这个函数我试了,但是报错,我可能用得不地道,我的代码是这样的
 
 复制代码void GetDimeAttachedSurface() {
        ProError err;
        ProMdl pSldMdl;
        err = ProMdlCurrentGet(&pSldMdl);
        /* 选择尺寸 */
        ProSelection *dims;
        int nDim = 0;
        err = ProSelect("annot_elem", 1, NULL, NULL, NULL, NULL, &dims, &nDim);   // gtol为 Geometric tolerance 
        if (PRO_TK_NO_ERROR != err || 1 != nDim)
        {
                AfxMessageBox(_T("errors occured in ProSelect()"));
                return;
        }
        ProAnnotationElem annotationElem;
        err = ProSelectionModelitemGet(dims[0], &annotationElem);
        if (PRO_TK_NO_ERROR != err || 1 != nDim)
        {
                AfxMessageBox(_T("errors occured in ProSelectionModelitemGet()"));
                return;
        }
        // 提取尺寸关联几何
        ProAnnotationPlane* annotation_plane;
        err = ProArrayAlloc(0, sizeof(ProAnnotationPlane), 1, (ProArray*)&annotation_plane);
        if (err != PRO_TK_NO_ERROR)
                return;
        ProDimAttachment** attachments_arr;
        err = ProArrayAlloc(0, sizeof(ProDimAttachment*), 1, (ProArray*)&attachments_arr);
        if (err != PRO_TK_NO_ERROR)
                return;
        //ProDimSense** dsense_arr;
        //ProDimOrient* orient_hint;
        err = ProDimensionAttachmentsGet(&annotationElem, annotation_plane, attachments_arr, NULL, NULL);
        if (PRO_TK_BAD_INPUTS == err)
        {
                AfxMessageBox(_T("errors occured in ProDimensionAttachmentsGet(), PRO_TK_BAD_INPUTS"));
                return;
        }
        else if (PRO_TK_INVALID_ITEM == err) {
                AfxMessageBox(_T("errors occured in ProDimensionAttachmentsGet(), PRO_TK_INVALID_ITEM"));
                return;
        }
        ProArrayFree((ProArray*)&annotation_plane);
        ProDimattachmentarrayFree(*attachments_arr);
}
 
 报错信息是: PRO_TK_BAD_INPUTS    # One or more of the input arguments are invalid.
 可以帮我看看吗?谢谢
 | 
 |