Replace Template and delete the tables in the drawing


ProError UserReplaceTemplate()
{
    ProMdl curMdl;
    proErr = ProMdlCurrentGet(&curMdl);  //The drawing model
 
    ProMdl format;
    proErr = ProMdlLoad(L"J:\\workdir\\12791530\\new\\a3_asm_xmy.frm.2", PRO_MDL_UNUSED, PRO_B_FALSE, &format);
 
    ProDwgtable *tables = NULL;
    proErr = ProDrawingTablesCollect(static_cast<ProDrawing>(curMdl), &tables);
    int tableQty = 0;
    proErr = ProArraySizeGet(tables, &tableQty);
 
    ProBoolean isFromFormat = PRO_B_FALSE;
    for (int i = 0; i < tableQty; ++i)
    {
        proErr = ProDwgtableIsFromFormat(&tables[i], &isFromFormat);
        if (PRO_B_TRUE == isFromFormat)
        {
            proErr = ProDwgtableDelete(&tables[i], 0);
        }
    }
 
    proErr = ProDrawingFormatAdd(static_cast<ProDrawing>(curMdl), 0, NULL, format, 0);
 
    proErr = ProWindowRepaint(PRO_VALUE_UNUSED);
 
    proErr = ProArrayFree(reinterpret_cast<ProArray *>(&tables));
    
    return proErr;
}





阅读更多
个人分类: CREO2.0
上一篇Replace Famtable Instance In The Creo Assembly
下一篇How to use mapkey
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭