Proe Creo 二次开发之获取外部参考信息

/*====================================================================*\
  Function : ProTestExtFeatRefProcess()
  Purpose  : 
\*====================================================================*/
ProError  ProTestExtFeatRefProcess( ProExtFeatRef ref)
{
    ProError err = PRO_TK_NO_ERROR;
    ProRefState state = PRO_REF_ACTIVE;
    ProType type;
    ProAsmcomppath own_comp, ref_comp;
    ProSolid solid;
    ProFeature feature;
    ProModelitem modelitem;

    own_comp.table_num = ref_comp.table_num = 0;
    feature.type = PRO_TYPE_UNUSED;
    modelitem.type = PRO_TYPE_UNUSED;

    err = ProExtRefStateGet ( ref, &state);
    TEST_CALL_REPORT ("ProExtRefStateGet()",
	"ProTestExtFeatRefProcess()", err ,
         err != PRO_TK_NO_ERROR);



    err = ProExtRefTypeGet ( ref, &type);
    TEST_CALL_REPORT ("ProExtRefTypeGet()",
	"ProTestExtFeatRefProcess()", err ,
         err != PRO_TK_NO_ERROR);
    

    err = ProExtRefAsmcompsGet (ref, &own_comp, &ref_comp);
    TEST_CALL_REPORT ("ProExtRefAsmcompsGet()",
	"ProTestExtFeatRefProcess()", err ,
         err != PRO_TK_NO_ERROR);

   /* if (ref_comp.table_num != 0)
    {
	ProTKFprintf (qcr_ref, "owner's asmcomppath model:\n");
	err = ProTestSolidInfoWrite (qcr_ref, own_comp.owner);
	ProTKFprintf (qcr_ref, "Reference's asmcomppath model:\n");
        err = ProTestSolidInfoWrite (qcr_ref, ref_comp.owner);
    }
*/
    //ProTKFprintf (qcr_ref, "Owner's asmcomppath:\n");
   /* for (i=0; i<own_comp.table_num; i++)*/
	//ProTKFprintf (qcr_ref, "%d ", own_comp.comp_id_table[i]);
    
 //   ProTKFprintf (qcr_ref, "\nReference's asmcomppath:\n");
 //   for (i=0; i<ref_comp.table_num; i++)
	ProTKFprintf (qcr_ref, "%d ", ref_comp.comp_id_table[i]);

    err = ProExtRefOwnMdlGet (ref, &solid);
    TEST_CALL_REPORT ("ProExtRefOwnMdlGet()",
	"ProTestExtFeatRefProcess()", err ,
         err != PRO_TK_NO_ERROR);
   // ProTKFprintf (qcr_ref, "\nOwner model:\n");
    //err = ProTestSolidInfoWrite (qcr_ref, solid);

     err = ProExtRefMdlGet (ref, &solid);
    TEST_CALL_REPORT ("ProExtRefMdlGet()",
	"ProTestExtFeatRefProcess()", err ,
         err != PRO_TK_NO_ERROR);
//   	ProTKFprintf (qcr_ref, "Reference model:\n");
//	err = ProTestSolidInfoWrite (qcr_ref, solid); 
	
    err = ProExtRefOwnFeatGet (ref, &feature);
    TEST_CALL_REPORT ("ProExtRefOwnFeatGet()",
	"ProTestExtFeatRefProcess()", err ,
         err != PRO_TK_NO_ERROR);
    if (feature.type != PRO_TYPE_UNUSED)
    {
	//ProTKFprintf (qcr_ref, "Owner feature ID: %d\n", feature.id);
	//ProTKFprintf (qcr_ref, "Owner feature type: %d\n", feature.type);
       /* err = ProTestSolidInfoWrite (qcr_ref, (ProSolid)feature.owner);*/
    }

    err = ProExtRefFeatGet (ref, &feature);
    TEST_CALL_REPORT ("ProExtRefFeatGet()",
	"ProTestExtFeatRefProcess()", err ,
         err != PRO_TK_NO_ERROR);
    if (feature.type != PRO_TYPE_UNUSED)
    {
	//ProTKFprintf (qcr_ref, "Reference feature ID: %d\n", feature.id);
	//ProTKFprintf (qcr_ref, "Reference feature type: %d\n", feature.type);
 //       err = ProTestSolidInfoWrite (qcr_ref, (ProSolid)feature.owner);
    }

    err = ProExtRefModelitemGet (ref, &modelitem);
	TEST_CALL_REPORT ("ProExtRefModelitemGet()",
		"ProTestExtFeatRefProcess()", err ,
         err != PRO_TK_NO_ERROR);
	ProName name;
	err = ProModelitemNameGet(&modelitem,name);
	ASSERT_STATUS(err);

    if (modelitem.type != PRO_TYPE_UNUSED)
    {
	/*ProTKFprintf (qcr_ref, "Reference modelitem ID: %d\n", modelitem.id);
	ProTKFprintf (qcr_ref, "Reference modelitem type: %d\n", modelitem.type);*/
        
    }

    return (err);
}

 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值