关闭

Replace Template and delete the tables in the drawing

182人阅读 评论(0) 收藏 举报
分类:


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;
}





0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:10294次
    • 积分:524
    • 等级:
    • 排名:千里之外
    • 原创:44篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条
    文章分类