获取组件内的对象

	/**
	 * 获取组件内的实体
	 * param instanceTag 判断传入的是68 还是63类型
	 * param bodys
	 * return
	 */
	int MODL::ASSEM_ask_instance_body(tag_t instanceTag, vector<tag_t>& bodys)
	{

		tag_t protoOBJ = 0;
		int _type = 0, _subtype = 0;
		UF_OBJ_ask_type_and_subtype(instanceTag, &_type, &_subtype);
		if (_type == 63)
		{
			//protoOBJ =UF_ASSEM_ask_prototype_of_occ(instanceTag);
			protoOBJ = instanceTag;
		}
		else if (_type == 68)
		{

			tag_t* occ_list = 0;
			UCall(UF_ASSEM_ask_part_occs_of_inst(instanceTag, &occ_list));
			//protoOBJ = UF_ASSEM_ask_prototype_of_occ(occ_list[0]);
			protoOBJ = occ_list[0];
			UF_free(occ_list);
		}
		tag_t member = 0;
		UCall(UF_ASSEM_cycle_objs_in_comp(protoOBJ, &member));

		while (member != NULL_TAG)
		{
			int type = 0, subType = 0;
			UF_OBJ_ask_type_and_subtype(member, &type, &subType);
            
            //获取其他类型 改这里
			if (type == 70 && subType == 0)
			{
				bodys.push_back(member);
			}
			UF_ASSEM_cycle_objs_in_comp(protoOBJ, &member);
		}

		return 0;
	}

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值