




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、1函數(shù)的含義?函數(shù)的含義?n可以通過(guò)查詢可以通過(guò)查詢UG/Open API的函的函數(shù)時(shí)獲得數(shù)時(shí)獲得。2UF_MODL_create_block1 Creates a block. The Corner Point indicates the origin of the block to be created. The X, Y and Z lengths control the size of the edge lengths. The sign parameter controls the boolean operation performed. The output of this fun
2、ction is the object identifier associated to the block. The origin point is with respect to the Absolute CSYS. However, the direction of the edge lengths are with respect to the WCS.34extern int UF_MODL_create_block1 (UF_FEATURE_SIGN sign, extern int UF_MODL_create_block1 (UF_FEATURE_SIGN sign, doub
3、le corner_pt3, char double corner_pt3, char * * edge_len3, tag_t edge_len3, tag_t * * blk_obj_id ); blk_obj_id );UF_FEATURE_SIGN signInput The sign of the operation to be performed.UF_NULLSIGN = create new target solidUF_POSITIVE = add to target solidUF_NEGATIVE = subtract from target solidUF_UNSIGN
4、ED = intersect with target soliddouble corner_pt3 Input Corner point (origin) of blockchar * edge_len 3 Input Three edge lengths of blocktag_t * blk_obj_idOutputFeature object identifier of created block.5注注 意!意!n在在UG/OPEN API的功能函數(shù)中用到的描述實(shí)的功能函數(shù)中用到的描述實(shí)體的幾何特性值的變量是體的幾何特性值的變量是字符型字符型(char)的數(shù)的數(shù)據(jù),而不是我們通常習(xí)慣使
5、用的據(jù),而不是我們通常習(xí)慣使用的實(shí)型數(shù)據(jù)實(shí)型數(shù)據(jù)(double)。)。 如如: :本例中本例中block的的長(zhǎng)、寬、高長(zhǎng)、寬、高的表示即用的表示即用char *block_len3 = 1,2,3來(lái)說(shuō)來(lái)說(shuō)明。明。 6應(yīng)用舉例應(yīng)用舉例 n線性陣列(線性陣列(line instance)和和環(huán)形陣列環(huán)形陣列(Circular instance) 7線性陣列線性陣列n線性陣列線性陣列指一個(gè)特指一個(gè)特征在一個(gè)實(shí)體上按給定征在一個(gè)實(shí)體上按給定距離和方向進(jìn)行行和列距離和方向進(jìn)行行和列復(fù)制多個(gè),最后結(jié)果象復(fù)制多個(gè),最后結(jié)果象一個(gè)矩陣一樣排列。一個(gè)矩陣一樣排列。 8環(huán)形陣列環(huán)形陣列n環(huán)形陣列環(huán)形陣列 指一個(gè)特
6、指一個(gè)特征在一個(gè)實(shí)體上按給征在一個(gè)實(shí)體上按給定半徑和角度復(fù)制多定半徑和角度復(fù)制多個(gè),最后結(jié)果成環(huán)形個(gè),最后結(jié)果成環(huán)形排列。排列。 9任任 務(wù)務(wù)n在在block(長(zhǎng)方體)或長(zhǎng)方體)或cylinder(圓柱體)圓柱體)上進(jìn)行槽或孔的線性陣列。上進(jìn)行槽或孔的線性陣列。 10需要的功能函數(shù)需要的功能函數(shù)n UF_MODL_create_block1生成實(shí)體生成實(shí)體blockn UF_MODL_create_cyl1 生成實(shí)體生成實(shí)體cylindern UF_MODL_create_list 生成實(shí)體鏈表(被陣生成實(shí)體鏈表(被陣 列的實(shí)體必須進(jìn)入鏈表)列的實(shí)體必須進(jìn)入鏈表)n UF_MODL_put_l
7、ist_item把實(shí)體把實(shí)體ID號(hào)加入號(hào)加入鏈表尾鏈表尾n UF_MODL_create_linear_iset 完成線性陣列完成線性陣列11功能函數(shù)說(shuō)明功能函數(shù)說(shuō)明 nUF_MODL_create_cyl1 Creates a cylinder. The origin indicates where the center of the bottom face is located for the cylinder. The direction vector controls the axis on which the cylinder is created. The diameter and
8、 height control the size of the cylinder. The sign parameter controls the boolean operation performed. The output of this function is the object identifier associated to the cylinder. 1213功能函數(shù)說(shuō)明功能函數(shù)說(shuō)明nextern int extern int UF_MODL_create_cyl1UF_MODL_create_cyl1 ( (UF_FEATURE_SIGN sign, UF_FEATURE_SI
9、GN sign, double origin 3 , double origin 3 , char char * * height, height, char char * * diam, diam, double direction 3 , double direction 3 , tag_t tag_t * * cyl_obj_id ); cyl_obj_id ); 14功能函數(shù)說(shuō)明功能函數(shù)說(shuō)明nUF_MODL_create_list Creates a linked list of objects. A list of objects may contain identifiers fo
10、r bodies, features, faces and edges. You use this routine to create a list for those modeling routines that require a list as an input; please do not use this for ask routines that return lists. 15功能函數(shù)說(shuō)明功能函數(shù)說(shuō)明n extern int extern int UF_MODL_create_listUF_MODL_create_list ( ( uf_list_p_t uf_list_p_t
11、* * list ); list );uf_list_p_t * list Output List of object identifiers16功能函數(shù)說(shuō)明功能函數(shù)說(shuō)明nUF_MODL_put_list_item Adds the input object identifier Adds the input object identifier to the end of the list that you to the end of the list that you input.input. NOTE: Duplicate tags added to the list are ignore
12、d. 17功能函數(shù)說(shuō)明功能函數(shù)說(shuō)明nextern int extern int UF_MODL_put_list_itemUF_MODL_put_list_item ( (uf_list_p_t list, uf_list_p_t list, tag_t obj_id );tag_t obj_id );uf_list_p_t list Input List of object identifiers. tag_t obj_idInput Object identifier to put into list 18功能函數(shù)說(shuō)明功能函數(shù)說(shuō)明nUF_MODL_create_linear_iset Cr
13、eates a linear instance set feature using the existing work coordinate system. The values needed are the number in the XC direction, spacing for the XC direction, number in the YC direction, spacing in the YC direction, and a list of features to instance. The output of this function is the object id
14、entifier associated to the linear instance set. The method options correspond to what is available interactively. See the Modeling User Manual for details. 19功能函數(shù)說(shuō)明功能函數(shù)說(shuō)明extern intextern int UF_MODL_create_linear_isetUF_MODL_create_linear_iset ( (int method,int method, char char * * number_in_x, num
15、ber_in_x, char char * * distance_x, distance_x, char char * * number_in_y, number_in_y, char char * * distance_y, distance_y, uf_list_p_t feature_list, uf_list_p_t feature_list, tag_t tag_t * * feature_obj_id ); feature_obj_id ); 20int method InputMethod:0 = General1 = Simple2 = Identical21實(shí)實(shí) 例例n編制孔
16、在編制孔在block上進(jìn)行實(shí)體線性陣列的程上進(jìn)行實(shí)體線性陣列的程序代碼(假設(shè)建立的工程名稱為序代碼(假設(shè)建立的工程名稱為blk) 22步步 驟驟 n生成一個(gè)生成一個(gè)長(zhǎng)方體長(zhǎng)方體block,它的尺寸、位置它的尺寸、位置可任意給定可任意給定n生成一個(gè)圓柱體生成一個(gè)圓柱體cylinder,讓它與已生成讓它與已生成的的block進(jìn)行布爾進(jìn)行布爾減減運(yùn)算(運(yùn)算(boolean subtract ),),得到一個(gè)有孔的復(fù)合體。得到一個(gè)有孔的復(fù)合體。n實(shí)現(xiàn)在復(fù)合體中圓柱孔在長(zhǎng)方體中的線性實(shí)現(xiàn)在復(fù)合體中圓柱孔在長(zhǎng)方體中的線性陣列(陣列(line instance),),陣列方向、距陣列方向、距離、位置可以任意
17、給定。離、位置可以任意給定。23建立框架建立框架n程序的宏聲明程序及與程序的宏聲明程序及與UG的入口函數(shù)、的入口函數(shù)、卸除函數(shù)均可從卸除函數(shù)均可從UG的例程中拷貝獲得。的例程中拷貝獲得。24實(shí)實(shí) 現(xiàn)現(xiàn)n建立新工程,例如建立新工程,例如Blk并設(shè)置工程環(huán)境并設(shè)置工程環(huán)境。n利用利用VC中的中的FileNew建立一個(gè)新建立一個(gè)新的的 .CPP文件。文件。n輸入程序代碼輸入程序代碼n編譯、聯(lián)編后,生成動(dòng)態(tài)鏈接庫(kù)編譯、聯(lián)編后,生成動(dòng)態(tài)鏈接庫(kù)blk.dll。25static void do_ugopen_api(float abc ,float orig1 ,float orig2 ) int meth
18、od=0; /Method:0 = General,1 = Simple,2 = Identical; double block_orig3 = orig10,orig11,orig12; double cyl_orig3=orig20,orig21,orig22; char *block_len3; char bb420; char *cyl_height; char *cyl_diam; char cc320; double direction3=0,0,1; char *number_in_x ; char *distance_x ; char *number_in_y ; char *
19、distance_y ; char dd520; tag_t blk_obj ; tag_t cyl_obj_id; uf_list_p_t feature_list ; tag_t feature_obj_id; 變量申明變量申明 float_to_char(abc0,bb0); block_len0=bb0; float_to_char(abc1,bb1); block_len1=bb1; float_to_char(abc2,bb2); block_len2=bb2; UF_CALL(UF_MODL_create_block1(sign, block_orig, block_len, &
20、blk_obj); float_to_char(abc3,cc0); cyl_height=cc0; float_to_char(abc4,cc1); cyl_diam=cc1; UF_CALL(UF_MODL_create_cyl1(sign1, cyl_orig, cyl_height, cyl_diam,direction, &cyl_obj_id);27 float_to_char(abc5,dd0 ); number_in_x =dd0; float_to_char(abc6,dd1); distance_x = dd1; float_to_char(abc7,dd2); numbe
21、r_in_y = dd2; float_to_char(abc8,dd3); distance_y =dd3; UF_CALL(UF_MODL_create_list(&feature_list); UF_CALL(UF_MODL_put_list_item(feature_list,cyl_obj_id); UF_CALL(UF_MODL_create_linear_iset ( method, number_in_x, distance_x, number_in_y, distance_y, feature_list, &feature_obj_id ); return; 28void m
22、ain( ) float abc9=5.0,4.0,3.0,4.0,0.5,3.0,1.5,2.0,1.5;/長(zhǎng)方體和圓柱體的尺寸參數(shù)長(zhǎng)方體和圓柱體的尺寸參數(shù) blX blY blZ cylH cylD 陣列參數(shù)陣列參數(shù)X XL Y YL float orig13=0.0,0.0,0.0; /長(zhǎng)方體的原點(diǎn)長(zhǎng)方體的原點(diǎn)float orig23=1.0,1.0,0.0; /圓柱體的原點(diǎn)圓柱體的原點(diǎn)do_ugopen_api(abc,orig1,orig2);29運(yùn)行結(jié)果運(yùn)行結(jié)果30作業(yè)一、作業(yè)一、完成球體打孔完成球體打孔尺寸:尺寸:sphere(直徑)(直徑) =(100) cylinder(直徑,高度)
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 家電面板出售合同范本
- 五軸數(shù)控系統(tǒng)加工編程與操作 課件全套 項(xiàng)目1-6 五軸數(shù)控機(jī)床分類及典型應(yīng)用-五軸機(jī)床工件測(cè)頭應(yīng)用
- 小學(xué)生文明禮儀(定義、校園、家庭、社會(huì)及培養(yǎng))
- 達(dá)州水務(wù)集團(tuán)有限公司2024年公開(kāi)招用人員(20人)筆試參考題庫(kù)附帶答案詳解
- 數(shù)據(jù)標(biāo)注合作合同范本
- 2025至2030年中國(guó)棉織手套數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 2025至2030年中國(guó)木制兒童椅數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 2025至2030年中國(guó)數(shù)碼電暈處理機(jī)數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 2025至2030年中國(guó)控溫式直條米粉擠壓機(jī)數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 2025至2030年中國(guó)抽濕吸風(fēng)燙臺(tái)數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 航天集團(tuán)人才隊(duì)伍建設(shè)經(jīng)驗(yàn)介紹
- 牙周炎-侵襲性牙周炎
- 心理委員工作記錄表
- 新教科版五下科學(xué)1-5《當(dāng)環(huán)境改變了》公開(kāi)課課件
- 教師的十大轉(zhuǎn)變課件
- 焦化廠生產(chǎn)工序及工藝流程圖
- 可下載打印的公司章程
- 中藥熏洗法課件
- 本特利探頭應(yīng)用
- QMR-110-00員工手部、接觸面等微生物檢驗(yàn)記錄記錄
- 外陰及陰道炎癥
評(píng)論
0/150
提交評(píng)論