
發(fā)布
注冊(cè)
/
登錄hm_createmark的案例
HyperWorks二次開(kāi)發(fā)常用命令介紹
分享幾個(gè)小命令
1.語(yǔ)法hm_answernext answer
answer有效值為yes,no,all(對(duì)'all to all')和nall(對(duì)于'all to all')。
為Tcl腳本的下一個(gè)命令提供答案
2. hm_appendmark
語(yǔ)法hm_appendmark entity_type mark_id "?option?" "list"
該命令將把entity_type的實(shí)體放置到mark_id標(biāo)記上。有效的mark_id是1和2.根據(jù)指定的選項(xiàng),支持的entity_types將會(huì)改變。
To delete the elements adjacent to the elements in components with names FRONT and SIDE:
hm_createmark elems 1 "by comp name" "FRONT SIDE"
hm_createmark elems 2 "[hm_getmark elems 1]"
hm_appendmark elems 1 "advanced" "by adjacent"
*markdifference elems 1 elems 2
3 *deletemark 刪除mark里面的內(nèi)容
*deletemark elems 1
4. *deletemodel 刪除模型
5 hm_blockerrormessages控制錯(cuò)誤是否 顯示
展開(kāi) tcl語(yǔ)言hypermesh二次開(kāi)發(fā) 門洞屈曲自動(dòng)化計(jì)算程序 optistruct求解器 ¥500
</p><p>*createmark surfaces 1 "all"</p><p>*createplane 1 0 0 1 0 0 0</p><p>*surfacemarksplitwithplane 1 1</p><p><br></p><p>*createmark surfaces 1 1 12</p><p>*createmark lines 2 9 7 10-13</p><p>*createvector 1 0 0 1</p><p>*surfacemarksplitwithlines 1 2 1 9 0</p><p><br></p><p>*createmark surfs 1 13 14</p><p>*deletemark surfs 1</p><p>################################################################################</p><p><br></p><p>#################################################################################</p><p>*createentity comps cardimage=HM_COMP includeid=6 name=jiaqiangban</p><p>*currentcollector components "jiaqiangban"</p><p>hm_createmark lines 1 "by comps" "TEMP2"</p><p>*createvector 1 0 0 1</p><p>*surfacecreatedraglinealongvector 1 1 -$s1 0 0 0 0 0</p><p><br></p><p><br></p><p>hm_createmark
展開(kāi) HyperWorks API類比【1】
常用的與mark先關(guān),而且類似的函數(shù)小結(jié)如下:
======================
*createmark
創(chuàng)建mark,后面參數(shù)有十幾種形式,涉及到不用的選擇方式,開(kāi)發(fā)中,用好其中的選擇模型,也是對(duì)于后續(xù)開(kāi)發(fā)一個(gè)好程序的關(guān)鍵。
hm_createmark
該命名同上述createmark命令相同,區(qū)別在與mark時(shí),如果后面參數(shù)通過(guò)list傳遞,*createmark可能會(huì)不進(jìn)行變量的替換而導(dǎo)致報(bào)錯(cuò),而hm_createmark不會(huì)有這個(gè)情況。當(dāng)然,通過(guò)eval也是可以解決前面的問(wèn)題
hm_getmark
獲取前面mark標(biāo)記的ID。
展開(kāi) HyperWorks API類比【1】
常用的與mark先關(guān),而且類似的函數(shù)小結(jié)如下:
======================
*createmark
創(chuàng)建mark,后面參數(shù)有十幾種形式,涉及到不用的選擇方式,開(kāi)發(fā)中,用好其中的選擇模型,也是對(duì)于后續(xù)開(kāi)發(fā)一個(gè)好程序的關(guān)鍵。
hm_createmark
該命名同上述createmark命令相同,區(qū)別在與mark時(shí),如果后面參數(shù)通過(guò)list傳遞,*createmark可能會(huì)不進(jìn)行變量的替換而導(dǎo)致報(bào)錯(cuò),而hm_createmark不會(huì)有這個(gè)情況。當(dāng)然,通過(guò)eval也是可以解決前面的問(wèn)題
hm_getmark
獲取前面mark標(biāo)記的ID。
展開(kāi) 
VS Code自動(dòng)補(bǔ)全Hypermesh二次開(kāi)發(fā)函數(shù) ¥8.9
Tcl Query Commands涵蓋hm_createmark等565個(gè)。
Tcl Modify Commands涵蓋*createmark等1807個(gè)。
2.實(shí)際效果
3.下載鏈接
HyperMesh二次開(kāi)發(fā)實(shí)例
*createmark comps 1 all
set mycomps [ hm_getmark comps 1 ]
*clearmark comps 1
set NumFail 0
set hmname [hm_info hmfilename]
set Errorlog [file join [file dirname $hmname] "error.log"]
set fid [open $Errorlog w]
puts $fid "The file is generated by Midsurface."
foreach Compid $mycomps {
set Compname [hm_getcollectorname comps $Compid]
hm_createmark solids 1 "by component" $Compname
set SolidIds [hm_getmark solids 1]
set NumSolids [llength $SolidIds]
puts "$Compname has $NumSolids solids "
if {$NumSolids < 1} {
incr NumFail
puts -nonewline $fid $NumFail
puts -nonewline $fid ". "
puts -nonewline $fid "\["
puts -nonewline $fid $Compname
puts -nonewline $fid "\] "
puts $fid ", Failure=No Solid in $Compname."
展開(kāi) Hyperworks自動(dòng)化案例研究
elements#
hm_createmark nodes 1 "by elem id" $selected_elem_ids
set node_ids [hm_getmark nodes 1]
#creating the 1D-rigid#
#1st node from the list is fed as the independent node id#
#rest of them are supplied as dependent nodes#
eval *createmark nodes 1 [lrange $node_ids 1 end]
*rigidlinkwithset [lindex $node_ids 0] 1 0 123456
}
}
結(jié)果看起來(lái)像這樣:
現(xiàn)在,您可以更輕松地快速創(chuàng)建任意數(shù)量的裝備。
展開(kāi)