
發布
注冊
/
登錄ansys自學筆記
關注創建者:王靖雯 創建時間:2023-03-08

ansys自學筆記的實例教程
*createmark elems 1 displayed
hm_getedgeloops elems markid=1 looptype=2
hm_getedgeloops
Returns surface and element free and non-manifold edge loop entities.
返回無曲面和元素的非流形循環邊實體
Syntax
hm_getedgeloops entity_type markid=<mark_id> ?looptype=<loop_type>? ?featureangle=<angle>? ?refmarkid=<mark_id>? ?restricttoinput=<value>?
Description
Returns surface and element free and non-manifold edge loop entities. The return is a "list of loops". Each loop is an ordered list of either surface edge or element node IDs that define each loop. The first value in each loop list is the loop type. The remaining values are the ordered node/surface edge IDs defining the loop. If the loop is closed, the first and last ID are the same.
For example:
{2 1 29 35 34 33 32 31 25 5 4 3 2 1 } {2 6 7 8
展開 Examples
Update the attribute Rho of material ID 1 along with Status to value 1:
*setvalue mats id=1 Rho=1.1 STATUS=1
自學語句1:
*setvalue props name = $name STATUS = 1 95=$bihou
自學語句2:
*setvalue comps name=$name propertyid=$props_id
自學語句3:
*setvalue props id =$props_id materialid = $mats_ids
*createmark
Syntax
*createmark entity_type mark_id "?option?" list
Examples
To delete all elements in the database:
*createmark elems 1 "all"
*deletemark elems 1
自學語句1:
*createmark comps 1 all
*deletemark comps 1
*clearmarkall
Clear all entity IDs for all entity types from the specified mark.
展開 Examples
Create a set with name set1, cardimage GRNOD:
*createentity sets name=set1 cardimage=GRNOD
自學語句:
*createentity props cardimage = SHELLSECTION name = $name
以上語句又等價于
*createentity props name=$name cardimage=SHELLSECTION
也就是?name1=value1? ?name2=value2? ... ?name3=valueN?順序可以任意排列。
hm_getvalue
Syntax
hm_getvalue entity_type <select_type>=<selection> dataname=<data name or attribute name/ID> ?row=<row_index>? ?column=<column_index>?
Examples
hm_getvalue sets id=1 dataname=name
自學語句:
hm_getvalue comps id = $comp_id dataname = name
hm_getvalue comps id=1 dataname=name
堅持每天學習,時間會證明一切,加油
展開 名稱
lsort - 給列表中的元素排序
語法
lsort ?options? list
描述
這個命令對list中的元素進行排序,返回一個重新排序的列表。lsort命令的執行使用歸并排序算法,所以排序性能穩定在(n log n)的級別。
默認使用ASCII表排序,但是以下的options選項也可以控制排序的方式:
-ascii
使用 ASCII表的字符順序排序,默認方式。
-dictionary
使用字典關系,基本上和 -ascii差不多,區別在于 -dictionary忽略了大小寫關系,而且把數字字符看作是數值來處理。比如在 -dictionary模式,bigBoy在bigbang和bigboy中間,x10y在x9y和x11y之間。
-integer
把列表元素轉換成整數并且使用整數關系排序。
-real
把列表元素轉換成浮點數并且使用浮點數關系排序。
-command
command
使用 command作為一個比較命令,比較兩個元素。這個命令需要返回一個整數,表示小于、等于或大于0,分別對應第一個元素是小于、等于還是大于第二個元素。
-increasing
排序時按照由小到大的順序排列,默認方式。
-decreasing
排序時按照由大到小的順序排列。
-indices
返回一個列表,包含的元素是排序后的元素對應以前的 list的索引。
-index
indexList
如果指定了這個選項,那么 list的元素必須是一個合法的Tcl子列表,將會根據子列表來進行排序
示例
使用ASCII對列表排序:
% lsort {a10 B2 b1 a1 a2}
B2 a1 a10 a2 b1
使用字典關系對列表排序:
展開 for循環是一個循環控制結構,可以有效地編寫需要執行特定的代碼次數。
for { set a 10} {$a < 20} {incr a} {
puts "value of a: $a"
}

ansys自學筆記的相關專題、標簽、搜索
ansys自學筆記的最新內容
lreplace命令是tcl語言中的一個列表操作命令,它用于替換列表中一個或多個元素。
語法: lreplace list first last ?element element ...?
參數介紹: list:要操作的列表。 first:第一個要替換的元素的索引,從0開始。 last:最后一個要替換的元素的索引,如果只想替換一個元素,則可將該參數設為同first一樣的值。 element
寫在前文
盡管減隔震技術與有限元結合取得了眾多成果,但仍面臨諸多挑戰,如材料非線性、模型不確定性等等。減隔震設計除了常規的宏觀結構設計采用SAP2000、Etabs、Midas、SSG、Paco-SAP 或 YJK\PKPM等。
【JY】各類有限元軟件計算功能賞析與探討
我們需要更清楚減隔震元件的破壞模式,對減隔震元件進行破壞分析,除了對減隔震元件在正常工況下的性能進行評估
set comps [hm_getstring "comps" "please input a comps name"]
*collectorcreateonly comps $comps "" 50
*createmarkpanel elem 1 "select elements to move"
*movemark elem 1 $comps
tcl腳本-lindex函數
語法:lindex list indiex
例:
set a {1 2 3 4 5}
lindex a 2
3 //返回第三個元素
或者:lindex list {}
這種情況下返回 lindex列表本身。
當只有一個單獨的元素時,lindex命令返回list列表中的第index
名稱
lsort - 給列表中的元素排序
語法
lsort ?options? list
描述
這個命令對list中的元素進行排序,返回一個重新排序的列表。lsort命令的執行使用歸并排序算法,所以排序性能穩定在(n log n)的級別。
默認使用ASCII表排序,但是以下的options選項也可以控制排序的方式:
-ascii
使用 ASCII表的字符順序排序
獲取節點坐標
hm_nodevalue $i coordates
執行如下代碼:
hm_nodevalue 1 coordates
(Documents) 176 % hm_nodevalue 145 coordates
{210000 10004 0.3}
# ###############選中第一個節點id############
*createmark nodes 2
hm_entitylist nodes id
# 輸出所有節點的id
hm_entitylist
Returns a list of names or IDs of all entities of the requested type.
Syntax
hm_entitylist entity_type name_or_id ?mode?
Type
使用命名空間命令創建命名空間。一個簡單的例子,創建命名空間如下圖所示
namespace eval MyMath {
# Create a variable inside the namespace
variable myResult
}
# Create procedures inside the namespace
proc MyMath::Add {a b } {
for循環是一個循環控制結構,可以有效地編寫需要執行特定的代碼次數。
for { set a 10} {$a < 20} {incr a} {
puts "value of a: $a"
}
eval命令
接收一個或多個參數,然后把所有的參數以空格隔開組合到一起成為一個腳本,然后對這個腳本進行求值。
proc test1 {var} \
{
if {$var == 1} {
puts "var is one"
} else {
puts "var is not one"
}
}
以上也等效于:
proc test1 {var} {
if {$var
