hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接

點擊上方藍字關注我們

hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖1
1

引言

     本文要實現(xiàn)的主要功能為運用hypemesh軟件,實現(xiàn)螺栓連接的半自動化創(chuàng)建,提升建模效率和準確度。

2

基本思路 

       hypemesh的Bolt面板可以較為簡便的創(chuàng)建螺栓連接,其基本操作流程如下:

       1.進入螺栓創(chuàng)建面板:1D-connetors-bolts

hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖2

        2.設置螺栓類型:

        在type面板下設置螺栓連接的類型

hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖3


hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖4        3.選擇創(chuàng)建螺栓連接位置:

        在location 下選擇要創(chuàng)建螺栓連接的節(jié)點位置,可以為圓心位置,也可以為圓上的一個節(jié)點

hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖5

4.選擇要創(chuàng)建螺栓連接的部件:

        在num layers 中選擇要創(chuàng)建螺栓連接的層數(shù)(兩層、三層或者更多),在connect what 中選擇要創(chuàng)建連接的部件

hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖6

5.設置容差,完成連接創(chuàng)建

        在tolerance中設置容差,其余可保持默認設置,點擊create ,可完成螺栓連接的創(chuàng)建。

hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖7

hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖8

    綜上所述,要實現(xiàn)螺栓連接的自動化創(chuàng)建,其思路可以為:

    1.選擇螺栓創(chuàng)建位置;

    2.選擇要創(chuàng)建螺栓的部件;

    3.調(diào)用hypemesh的bolt面板,進行螺栓創(chuàng)建。

    上述步驟中的難點在于螺栓創(chuàng)建位置的選取,對于批量螺栓創(chuàng)建,可以采用圓心位置進行螺栓創(chuàng)建,因此,本文要實現(xiàn)的核心內(nèi)容為螺栓中心節(jié)點的創(chuàng)建,hypemesh中hm_ce_gethmholes可以實現(xiàn)上述功能,函數(shù)的基本用法如下:

 

NAME
hm_ce_gethmholes - Get bolt holes information from components.
SYNTAX
hm_ce_gethmholes mark upbound lowbound outerFlag elementFlag orderFlag
TYPE
HyperMesh Tcl Query


DESCRIPTION
mark

Component mark

upbound

Maximum diameter to be considered a bolt hole

lowbound

Minimum diameter to be considered a bolt hole

outerFlag

Output the nodes of the outer circle around bolt holes (yes = 1, no = 0)

elementFlag

Output the elements around bolt holes  (yes = 1, no = 0)

orderFlag

Output nodes in order (yes = 1, no = 0)


EXAMPLE
To get the bolt holes between 0.0 to 15.0 from comps 1, 2:

*createmark(comps, 1) 1, 2

hm_ce_gethmholes 1 15.0 0.0 0 0 0

The results—Including componet ids, the centers of bolt holes, and node ids around bolt holes—would look like this:

{1 { {4.69760749465 -4.81066850679 5.0} {3107 4357 4359 4363 4361 4370 4376 4368 4366 3300 4369 4371 4364} }

{ {-5.75024512823 4.10484549438 5.0} {3108 4383 4390 4389 4397 4392 4398 4386 4387 4388 4384 3152 4385} }

}

{2 { {4.69760749465 -4.81066850679 0.0} {1768 1769 1770 1771 1772 1760 1761 1762 1763 1764 1765 1766 1767} }

}


hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖9


3

程序?qū)崿F(xiàn) 

本文腳本程序主要要實現(xiàn)的功能為:部件孔的識別及圓心的創(chuàng)建,具體如下:


hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖10

#選擇要創(chuàng)建圓心的部件

*createmarkpanel comps 1 "選擇要創(chuàng)建中面的部件"

#獲取部件孔信息

set total_list [lindex [hm_ce_gethmholes 1 15.0 0.0 0 0 0] 0]

#獲取列表的第一行到最后一行,去除包含的部件信息

set total_list [lrange $total_list 1 end]

#創(chuàng)建列表存儲圓心信息

set nodes_list [list]

foreach item $total_list {

#獲取圓心坐標

set positon [lindex $item 0]

#獲取圓心坐標X值

set x [lindex $positon 0]

#獲取圓心坐標y值

set y [lindex $positon 1]

#獲取圓心坐標Z值

set z [lindex $positon 2]

#創(chuàng)建圓心節(jié)點

*createnode $x $y $z 0 0 0

}




4

程序效果 


模型文件:

hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖11


程序結(jié)果:自動創(chuàng)建圓心節(jié)點

hypemesh二次開發(fā)-自動創(chuàng)建螺栓連接的圖12



登錄后免費查看全文
立即登錄
App下載
技術(shù)鄰APP
工程師必備
  • 項目客服
  • 培訓客服
  • 平臺客服

TOP

15
8
36