Hyperworks自動(dòng)化案例研究
自動(dòng)化項(xiàng)目的可行性通常取決于投資回報(bào)率,您可以從制作腳本或工具所需的投入中獲得回報(bào)。這種收益通常反映在一段較長(zhǎng)的時(shí)間內(nèi),工具的使用頻率以及它如何能夠簡(jiǎn)化它所建立的相關(guān)任務(wù)。
計(jì)算機(jī)輔助工程(CAE)是一個(gè)嚴(yán)重依賴于計(jì)算系統(tǒng)及其性能的領(lǐng)域。這大大增加了自動(dòng)化 - 幫助我們更快速地執(zhí)行重復(fù)和耗時(shí)的任務(wù)。
如果我們真的不擔(dān)心長(zhǎng)期的投資回報(bào)率呢?如果我們專注于手頭的任務(wù) - 制定即時(shí)解決方案,并完成它們,而不必?fù)?dān)心:(a)長(zhǎng)期利益,(b)可重用性? 雖然長(zhǎng)期ROI的相關(guān)性,CAE工程師在日常工作中遇到了很多暫時(shí)的問(wèn)題 - 這些問(wèn)題可以通過(guò)使用幾行代碼編寫腳本來(lái)解決。
根據(jù)我個(gè)人的經(jīng)驗(yàn),我看到團(tuán)隊(duì)成員在一些場(chǎng)景下苦苦掙扎,幾分鐘后編寫幾行代碼可能為他們節(jié)省了幾個(gè)小時(shí)的工作時(shí)間。當(dāng)然,這可能會(huì)或可能不會(huì)在將來(lái)有用,但嘿,我們?nèi)匀蛔屛覀兊纳钭兊幂p松!
這只是完全利用我們使用的計(jì)算能力 - 而且工作更智能。顯然,學(xué)習(xí)一些編碼和腳本有助于!
案例研究 - hypermesh
讓我們來(lái)討論一個(gè)CAE工程師常常會(huì)遇到的非常簡(jiǎn)單的情景:我們需要在一些FE組件(比如100+)之間創(chuàng)建大量的1D-rigid,
接近問(wèn)題:
現(xiàn)在,我需要花費(fèi)最少的時(shí)間(最好幾分鐘)來(lái)創(chuàng)建一個(gè)穩(wěn)定的腳本,我可以使用它來(lái)減少此手動(dòng)任務(wù)所需的時(shí)間。我們來(lái)回顧一下一些注意事項(xiàng):
預(yù)測(cè)組件中每個(gè)剛性的位置 - 太模糊,代碼太多,需要考慮太多變量!
選擇要使用其節(jié)點(diǎn)創(chuàng)建剛體的元素 - 可能會(huì)減少在創(chuàng)建剛性面板中選擇節(jié)點(diǎn)和選項(xiàng)的點(diǎn)擊次數(shù)。
重新加載剛性創(chuàng)建面板每次創(chuàng)建一個(gè)剛性,使事情發(fā)生得更快 - 它的可能性,讓它循環(huán)!
現(xiàn)在完成了,我們可以開(kāi)始編碼!以下是簡(jiǎn)要中的算法:
要求用戶選擇所需的元素
從選定的元素中查找節(jié)點(diǎn)
使用元素創(chuàng)建一個(gè)剛性
循環(huán)回元素選擇
如果沒(méi)有選擇元素,請(qǐng)退出
以下是以下代碼:
proc RigidCreateWithElements {} { #initialising to something other than null, so that the loop starts# set selected_elem_ids 0 while {$selected_elem_ids!=""} { #asking the user to select some elements as input# *createmarkpanel elems 1 "Select element(s) from both components" #Store selected element ids to a list# set selected_elem_ids [hm_getmark elems 1] #checking if user has selected any elements at all# if {$selected_elem_ids==""} { #if nothing is selected, continue to next iteration of the loop# #where the while condition exits the loop# tk_messageBox -message "Exiting rigid creation tool" continue; } #Checking if a collector named "rigids" exists# if {[catch {*collectorcreateonly comps "Rigids" "" 7}]} { #if collector already exists, make it current# *currentcollector component "Rigids" } #getting list of all nodes from the selected elements# hm_createmark nodes 1 "by elem id" $selected_elem_ids set node_ids [hm_getmark nodes 1] #creating the 1D-rigid# #1st node from the list is fed as the independent node id# #rest of them are supplied as dependent nodes# eval *createmark nodes 1 [lrange $node_ids 1 end] *rigidlinkwithset [lindex $node_ids 0] 1 0 123456 } }
結(jié)果看起來(lái)像這樣:
.jpg)
現(xiàn)在,您可以更輕松地快速創(chuàng)建任意數(shù)量的裝備。雖然這是一個(gè)相當(dāng)基本的應(yīng)用程序,但可以稍后修改,稍后可能會(huì)在某些其他情況下找到使用。嘗試編寫這樣的小腳本以最大限度地提高效率,甚至可以對(duì)讓其他人更容易生活的業(yè)務(wù)產(chǎn)生興趣。
工程師必備
- 項(xiàng)目客服
- 培訓(xùn)客服
- 平臺(tái)客服
TOP




















