1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| ProError status; int sel_count; ProSelection *psels = NULL; ProModelitem csys_feat; ProGeomitemdata *geom_data = NULL; ProCsysdata *p_csys = NULL; ProMdl solid; Pro3dPnt outline[2]; ProMatrix transf; ProSolidOutlExclTypes excludes[] = {PRO_OUTL_EXC_DATUM_PLANE, PRO_OUTL_EXC_DATUM_POINT, PRO_OUTL_EXC_DATUM_CSYS}; status = ProMessageDisplay(MSGFILE, "entermsg"); if ((ProSelect("csys", 1, NULL, NULL, NULL, NULL, &psels, &sel_count) != PRO_TK_NO_ERROR) || (sel_count < 1)) { return; } status = ProSelectionModelitemGet(psels[0], &csys_feat); status = ProGeomitemdataGet(&csys_feat, &geom_data); if (geom_data->obj_type != PRO_CSYS) { return; } p_csys = geom_data->data.p_csys_data; ProUtilVectorsToTransf(p_csys->x_vector, p_csys->y_vector, p_csys->z_vector, p_csys->origin, transf); status = ProMdlCurrentGet(&solid); status = ProSolidOutlineCompute((ProSolid)solid, transf, excludes, 3, outline); CString Msg; Msg.Format("长:%f\n宽:%f\n高:%f", abs(outline[1][0] - outline[0][0]), abs(outline[1][1] - outline[0][1]), abs(outline[1][2] - outline[0][2])); AfxMessageBox(Msg);
|