不知火舞的被虐|伊人天伊人天天综合网|博洛尼亚天气|任你懆这里只有精品4|久久美日韩精品久久|掌中之物漫画免费阅读观看|0丨d老妇

ansys自學筆記的案例

TCL自學筆記-02
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.
展開
TCL自學筆記-01
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 堅持每天學習,時間會證明一切,加油
展開
TCL自學筆記-03
*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
展開
TCL自學筆記-05 *createstringarray命令語法
Examples To create a string array with the strings "abc" and "def": *createstringarray 2 "abc" "def" 自學語句1: *createstringarray 2 "elements_on" "geometry_off" 創建2個字符串數組,"elements_on" "geometry_off" 以便在后續命令中使用 See Also *createarray *createdoublearray *createdoublearray2d *createentityarray2d *createintarray2d 堅持每天學習,時間會證明一切,加油
展開
ansys自學筆記圖1
TCL自學筆記-17 lsort命令
名稱 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 使用字典關系對列表排序:
展開
TCL自學筆記-13 for命令
for循環是一個循環控制結構,可以有效地編寫需要執行特定的代碼次數。 for { set a 10} {$a < 20} {incr a} { puts "value of a: $a" }
TCL自學筆記-20 lreplace命令
lreplace命令是tcl語言中的一個列表操作命令,它用于替換列表中一個或多個元素。 語法: lreplace list first last ?element element ...? 參數介紹: list:要操作的列表。 first:第一個要替換的元素的索引,從0開始。 last:最后一個要替換的元素的索引,如果只想替換一個元素,則可將該參數設為同first一樣的值。 element:要替換的元素。 示例: set my_list {a b c d e f g} set new_list [lreplace $my_list 2 4 x y z] puts $new_list 輸出: a b x y z f g 示例解釋: 在上面的示例中,我們首先定義了一個包含7個元素的列表my_list,然后使用lreplace命令將my_list列表中的第3個到第5個元素(即c、d和e)替換為x、y和z。最后,我們將新的列表存儲在new_list變量中,并使用puts命令將其輸出。 輸出結果為a b x y z f g。 lreplace:替換 / 刪除 指定 索引位置 / 索引范圍 的元素。 1、替換 (1)替換指定索引范圍的元素 puts "----------replace any element----------" set mylist {1 2 3} puts $mylist set mylist [lreplace $mylist 0 1 0]# 替換指定索引范圍的元素 puts $mylist 1 2 3 0 3 (2)替換指定索引位置的元素 puts "----------replace any element----------" set mylist {1 2 3} puts $mylist
展開
TCL自學筆記-12 eval命令
eval命令 接收一個或多個參數,然后把所有的參數以空格隔開組合到一起成為一個腳本,然后對這個腳本進行求值。 proc test1 {var} \ { if {$var == 1} { puts "var is one" } else { puts "var is not one" } } 以上也等效于: proc test1 {var} { if {$var == 1} { puts "var is one" } else { puts "var is not one" } } 運行完以上程序后再運行以下代碼: eval test1 1 或等效于: test1 1 (Documents) 465 % eval [set foo "puts hi"] hi
展開
TCL自學筆記-14 定義命名空間
使用命名空間命令創建命名空間。一個簡單的例子,創建命名空間如下圖所示 namespace eval MyMath { # Create a variable inside the namespace variable myResult } # Create procedures inside the namespace proc MyMath::Add {a b } { set ::MyMath::myResult [expr $a + $b] } MyMath::Add 10 23 puts $::MyMath::myResult 當執行上面的代碼,產生以下結果: 33 namespace eval MyMath { variable myResult } proc MyMath::Add {a b } { set ::MyMath::myResult [expr $a + $b] } MyMath::Add 10 23 puts $::MyMath::myResult 在上面的程序,可以看到有一個變量myResult和程序Add的一個命名空間。這使得創建變量和程序可根據相同的名稱在不同的命名空間。 以上程序也可以用以下定義函數的方法實現。 proc Add {a b } { return [expr $a + $b] } set c [Add 10 23] puts $c 嵌套的命名空間 TCL允許命名空間的嵌套。一個簡單的例子,嵌套的命名空間如下。 namespace eval extendedMath { # Create a variable inside the namespace namespace eval MyMath { #
展開
TCL自學筆記-06 after命令語法
after after主要用于要延遲一段時間再執行腳本,update主要用于處理掛起的事件和回調,vwait可以跟蹤一個變量的修改。 名稱 after - 等待一段時間后再執行命令 語法 after ms after ms ?script script script ...? after cancel id after cancel script script script ... after idle ?script script script ...? after info ?id? 間隔一段時間后執行一條命令: % set a a a % after 5000 set a b after#1 間隔5秒鐘后執行命令set a b,如果等待5秒鐘后再查看$a的值就變成b了。 堅持每天學習,時間會證明一切,加油!
展開
TCL自學筆記-18 lindex函數命令
tcl腳本-lindex函數 語法:lindex list indiex 例: set a {1 2 3 4 5} lindex a 2 3 //返回第三個元素 或者:lindex list {} 這種情況下返回 lindex列表本身。 當只有一個單獨的元素時,lindex命令返回list列表中的第index個元素。替代時元素從0開始(也就是說索引0就是指列表的第一個元素),如果index是負數或者大于列表長度就返回一個空字符串。解釋器在解釋每一個index值時和string index命令相同,都支持單個和多個index參數。 lindex {a b c} → a b cl index {a b c} {} → a b c lindex {a b c} 0 → a lindex {a b c} 2 → c lindex {a b c} end → c lindex {a b c} end-1 → b 如果指定了多個index,將會選擇列表的子列表中的元素。例如: lindex {{a b c} {d e f} {g h i}} 2 1 → h lindex {{a b c} {d e f} {g h i}} {2 1} → h lindex {{{a b} {c d}} {{e f} {g h}}} 1 1 0 → g lindex {{{a b} {c d}} {{e f} {g h}}} {1 1 0} → g set d [lindex
展開
ansys自學筆記圖2
TCL自學筆記-15 hm_entitylist命令
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 HyperMesh Tcl Query Description Returns a list of names or IDs of all entities of the requested type. Inputs entity_type The type of entity to query. name_or_id The type of list to generate. Valid values are: name - Return the list of names. Only named entity types support this option. id - Return the list of IDs. All entity types support this option. mode An optional argument that specifies which entity types are returned: active - Return only the active entities. This is the default if not specified. all - Return
展開
TCL自學筆記-07 proc函數命令語法
過程函數proc 語法格式:proc 函數名 參數列表 函數主體 功能:類似于C語言中的函數。即用戶自定義的功能,方便多次調用。 proc add {a b} { set sum [exp $a + $b] return $sum} puts [add 3 4] puts [add 66 11] 全局變量與局部變量 全局變量:在所有過程之外定義的變量 局部變量:對于在過程中定義的變量,因為它們只能在過程中被訪問,并且當過程退出時會被自動刪除。 指令global,可以在過程內部引用全部變量 set a 2 proc sample {x} { global a set a [expr $a+1] return [expr $a + $x]} puts [sample 3]
展開
TCL自學筆記-16 hm_nodevalue命令
獲取節點坐標 hm_nodevalue $i coordates 執行如下代碼: hm_nodevalue 1 coordates (Documents) 176 % hm_nodevalue 145 coordates {210000 10004 0.3} # ###############選中第一個節點id############ *createmark nodes 2 3 # ########測量節點3和坐標為20,20,20節點的距離輸出的是一個列表,第一個值是距離############ hm_measureshortestdistance2 20 20 20 nodes 2 0 0
展開
TCL自學筆記-08 foreach函數命令語法
foreach 循環指令foreach 語法格式:foreach 變量 列表 循環主體 功能:從第0個元素開始,每次按順序取得列表的一個元素,將其賦值給變量,然后執行循環主體一次,直到列表最后一個元素 set list1{1 2 3 4} foreach i $list1 { puts $i }