iCAx开思工具箱

标题: 三视图问题 [打印本页]

作者: hyccai    时间: 2011-6-10 17:48
标题: 三视图问题
模板建立成功,但建立一般视图是则说是输入参数错误

ProError UserCreateSheet()
{
ProError status;
ProMdl current_mdl;
status=ProMdlCurrentGet(&current_mdl);//
ProMdlType mdl_type;
status=ProMdlTypeGet(current_mdl,&mdl_type);
if(mdl_type!=PRO_MDL_PART&&mdl_type!=PRO_MDL_ASSEMBLY)
  return PRO_TK_GENERAL_ERROR;
//模型数据
ProMdldata mdl_data;
status=ProMdlDataGet(current_mdl,&mdl_data);
ProModel model;
ProWstringCopy(mdl_data.name,model.name,PRO_VALUE_UNUSED);
ProWstringCopy(mdl_data.type,model.type,PRO_VALUE_UNUSED);
//建立工程图
ProName drawing_name=L"Drawing";
ProWstringCopy(mdl_data.name,drawing_name,PRO_VALUE_UNUSED);
ProPath tmp_name=L"_a4.drw";
UserDirectoryFullPathGet("\\template\\",tmp_name);
ProDwgcreateOptions options = PRODWGCREATE_DISPLAY_DRAWING;
ProDwgcreateErrs  errors;
ProDrawing drawing;
status= ProDrawingFromTmpltCreate(drawing_name,tmp_name,&model,options, &drawing,&errors);
//获取当前图页
int sheet;
ProDrawingCurrentSheetGet(drawing,&sheet);
//设置一般视图方向
ProMatrix matrix,csysmat,inv_matrix;
ProUtilMatrixCopy(NULL,matrix);
ProUtilMatrixInvert( matrix, inv_matrix );
ProVector pos,outpos;
pos[0] = 200.0;
     pos[1] = 600.0;
     pos[2] = 0.0;
//建立一般视图
ProUtilPointTrans(inv_matrix,pos,outpos);
ProPntTrfEval (pos, inv_matrix, outpos);
ProView view;
    status=ProDrawingGeneralviewCreate(drawing,(ProSolid)current_mdl, sheet, PRO_B_FALSE, outpos, 1, matrix, &view);
CString str;
str.Format(_T("%d"),status);
AfxMessageBox(str);//打印出status 为-2 PRO_TK_BAD_INPUTS
return status;
}
作者: hyccai    时间: 2011-6-11 16:09
那位高手帮忙看下是那个参数有问题了。先谢啦!
作者: hyccai    时间: 2011-6-13 10:34
问题解决!也不知什么原因




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3