abaqus-python 利用getByBoundingCylinder(...)創建單元集合

1 命令解釋

命令解釋:返回包含在指定空間圓柱中的幾何元素或者網格元素的對象序列 ,下面是幫助文檔中對于這個命令的解釋:

getByBoundingCylinder(...)

This method returns an array of element objects that lie within the specified bounding cylinder.

Required arguments

center1

A tuple of the X-, Y-, and Z-coordinates of the center of the first end of the cylinder.

center2

A tuple of the X-, Y-, and Z-coordinates of the center of the second end of the cylinder.

radius

A float specifying the radius of the cylinder.

Optional arguments

None.

Return value

MeshElementArray object, which is a sequence of MeshElement objects.

主要就是指定圓柱體的上下端面的圓心以及半徑,返回的是elemets編號序列。

在學習的時候被網上的帖子和幫助文檔誤導(其實是新新手的緣故),命令老寫成這個樣子:

elist = e.getByBoundingCylinder(7,6,0,7,6,20,5.8)
# 正確命令:
elist = e.getByBoundingCylinder(center1=(7,6,0),center2=(7,6,20),radius=5.8)
abaqus python 二次開發攻略 P195,P196
abaqus 用戶幫助文檔

2 簡單案例

案例簡介:選取多個圓柱體框中的單元并創建為集合。

具體命令:

################################
# 可以運行#######
from abaqus import*
from abaqusConstants import*
p = mdb.models['Model-3'].parts['Part-1']
e = p.elements
elist_I = e.getByBoundingCylinder(center1=(7,6,0),center2=(7,6,20),radius=5.8) 
elist = elist_I
elist_I = e.getByBoundingCylinder(center1=(21,6,0),center2=(21,6,20),radius=5.8)
elist = elist+elist_I
p.Set(elements=elist,name='Set-matrix')
print(type(elist)) # <type 'Sequence'>
abaqus-python 利用getByBoundingCylinder(...)創建單元集合的圖1
abaqus-python 利用getByBoundingCylinder(...)創建單元集合的圖2

這就是運行結果。

希望可以幫助到各位,若有錯誤請多多指教!

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

TOP

2
1