hypemesh二次開發-自動創建螺栓連接
點擊上方藍字關注我們
引言
本文要實現的主要功能為運用hypemesh軟件,實現螺栓連接的半自動化創建,提升建模效率和準確度。
基本思路
hypemesh的Bolt面板可以較為簡便的創建螺栓連接,其基本操作流程如下:
1.進入螺栓創建面板:1D-connetors-bolts
2.設置螺栓類型:
在type面板下設置螺栓連接的類型
3.選擇創建螺栓連接位置:
在location 下選擇要創建螺栓連接的節點位置,可以為圓心位置,也可以為圓上的一個節點
4.選擇要創建螺栓連接的部件:
在num layers 中選擇要創建螺栓連接的層數(兩層、三層或者更多),在connect what 中選擇要創建連接的部件
5.設置容差,完成連接創建
在tolerance中設置容差,其余可保持默認設置,點擊create ,可完成螺栓連接的創建。
綜上所述,要實現螺栓連接的自動化創建,其思路可以為:
1.選擇螺栓創建位置;
2.選擇要創建螺栓的部件;
3.調用hypemesh的bolt面板,進行螺栓創建。
上述步驟中的難點在于螺栓創建位置的選取,對于批量螺栓創建,可以采用圓心位置進行螺栓創建,因此,本文要實現的核心內容為螺栓中心節點的創建,hypemesh中hm_ce_gethmholes可以實現上述功能,函數的基本用法如下:
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} }
}
程序實現
本文腳本程序主要要實現的功能為:部件孔的識別及圓心的創建,具體如下:
#選擇要創建圓心的部件
*createmarkpanel comps 1 "選擇要創建中面的部件"
#獲取部件孔信息
set total_list [lindex [hm_ce_gethmholes 1 15.0 0.0 0 0 0] 0]
#獲取列表的第一行到最后一行,去除包含的部件信息
set total_list [lrange $total_list 1 end]
#創建列表存儲圓心信息
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]
#創建圓心節點
*createnode $x $y $z 0 0 0
}
程序效果
模型文件:
程序結果:自動創建圓心節點
工程師必備
- 項目客服
- 培訓客服
- 平臺客服
TOP




















