91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 149KB
    文件類型: .rar
    金幣: 2
    下載: 1 次
    發布日期: 2021-06-11
  • 語言: C/C++
  • 標簽: Isigh??C+??

資源簡介

Isight集成UG10中UGupdate制作,C++二次開發,直接更新模型并輸出x_t

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?pressions.h>
using?namespace?std;
/*
功能:
?用exp文件更新prt文件文,并將prt文件另存為x_t文件
調用方法:
system(“you.prt???you.exp???you.x_t“)
createprocess(“you.prt“,“you.exp???d:\\you.x_t“...)
注意:
文件名一定要寫全,在導出時會自動刪除舊的文件否則可能
因為文件已經存在而導致導出x_t文件失敗。

???sannuaa202
                    visualsan@yahoo.cn
???2011.11.13
*/
int??prt_save_as_xt(tag_t?string?ps);
//引入lib文件,因人而異
#pragma??comment(lib“D:\\Program?Files\\Siemens\\NX?10.0\\UGOPEN\\libufun.lib“)
#define?VISUALSAN_NUAA_202_RUN(x)\
if(0!=x)\
{\
????char?msg[133];\
????UF_get_fail_message(?xmsg?);\
????cout<????return?-1;\
}

int??main(int?argc?char?**argv)
{

//實現初始化ug?api否則其它ug函數是無法使用的
VISUALSAN_NUAA_202_RUN(UF_initialize());

//文件路徑
string??prt?ep;
string??x_t;//x_t格式文件地址

/*參數個數檢查,
注意用system(“UG_update.exe?xx.prt??yy.exp“)調用時,
默認第一個參數為exe地址,所以你的參數
是第二個開始;用createprocess時,則參數和你傳遞的一樣
system(“UG_update.exe?xx.prt?yy.exp?yy.x_t“)
argv[0]=UG_update.exe?argv[1]=xx.prt?argv[2]=yy.exp??argv[3]=yy.x_t

createprocess(“UG_update.exe““xx.prt??yy.exp?yy.x_t“....)
argv[0]=xx.prt?argv[1]=yy.exp?argv[2]=yy.x_t*/

if?(argc? {
cerr?< return??-1;
}
//默認你是用createprocess創建線程的
if?(argc?==?3)
{
prt?=?argv[0];??//prt文件
ep?=?argv[1];??//exp文件
x_t?=?argv[2];?//x_t文件
}
//否則是用system調用的
else
{
prt?=?argv[1];?//prt文件
ep?=?argv[2];?//exp文件
x_t?=?argv[3];?//x_t文件
}

//打開模型文件
UF_PART_load_status_t?st;
tag_t??prt_id;
//打開prt文件
VISUALSAN_NUAA_202_RUN(UF_PART_open(prt.c_str()?&prt_id?&st));
//更新模型文件
VISUALSAN_NUAA_202_RUN(UF_MODL_import_exp((char*)ep.c_str()?0));
//更新模型
VISUALSAN_NUAA_202_RUN(UF_MODL_update());
//寫入文件
VISUALSAN_NUAA_202_RUN(UF_PART_save());

//另存為x_t文件
if?(-1?==?prt_save_as_xt(prt_id?x_t))
return?-1;

//關閉prt文件
VISUALSAN_NUAA_202_RUN(UF_PART_close(prt_id?1?1));
VISUALSAN_NUAA_202_RUN(UF_PART_free_load_status(&st));
//退出前UF_terminate調用清理
VISUALSAN_NUAA_202_RUN(UF_terminate());

return?0;
}
int??prt_save_as_xt(tag_t?body_tag?string?ps)
{
//沒有后綴名時,加上后綴名
if?(std::string::npos?==?ps.find(“.x_t“))
ps?+=?“.x_t“;
//引用代碼:Ug2Ansys.cpp??李?響?中國地質大學(北京)?2006.12.31
uf_list_p_t?body_list;
//?獲得裝配樹根事例root_part_occ?當函數返回NULL_TAG時?表明當前部件文件中沒有裝配(即單個部件)
tag_t?root_part_occ?=?UF_ASSEM_ask_root_part_occ(body_tag);
VISUALSAN_NUAA_202_RUN(UF_MODL_create_list(&body_list));
//?如果是單個部件
if?(root_part_occ?==?NULL_TAG)
{
tag_t?object?=?NULL_TAG;
int?UF_body_type;
int?type;
int?subtype;
do?{
VISUALSAN_NUAA_202_RUN(
UF_OBJ_cycle_objs_in_part(body_tag?UF_solid_type?&object)
);
if?(object?!=?NULL_TAG)
{
VISUALSAN_NUAA_202_RUN(
UF_OBJ_ask_type_and_subtype(object?&type?&subtype)
);
VISUALSAN_NUA

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????153127??2018-10-07?15:52??UGupdate制作及注意事項.docx

?????文件???????4695??2018-10-06?23:35??NX10_update7.cpp

?????文件??????83456??2018-10-06?23:15??NX10_update7.exe

-----------?---------??----------?-----??----

???????????????241278????????????????????3


評論

共有 條評論