The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
I am writing a script to hide to remove certain types of elements like rbe3s,rbe2s etc that are attached to a component. But I want to ask the user the type of elements he wants to remove. Is there anyway I can take this input?
The simple way is asking user to choice one element and you get element type from this selected element.
So user has selected element type indirectly, via element.
*createmarkpanel elems 1 'Select Element' set eList [hm_getmark elems 1] hm_markclear elems 1 set eid [lindex $eList 0] # we work only with the 1st element set typename [hm_getvalue elems id=$eid dataname=typename] puts 'Element type= $typename' # Do something with selected typename
You can have also the user to type a string with the element type name:
set user_choice [hm_getstring 'buttom name' 'some string']
Then do something.
The simple way is asking user to choice one element and you get element type from this selected element. So user has selected element type indirectly, via element. *createmarkpanel elems 1 'Select Element' set eList [hm_getmark elems 1] hm_markclear elems 1 set eid [lindex $eList 0] # we work only with the 1st element set typename [hm_getvalue elems id=$eid dataname=typename] puts 'Element type= $typename' # Do something with selected typename
thank you so much(thank you for your other answers in other threads as well)! I have another doubt, if i select multiple elements from the panel, in what order are they stored in the list.
You can have also the user to type a string with the element type name: set user_choice [hm_getstring 'buttom name' 'some string'] Then do something.
Thank you!!
When you get information from user, you have always some risk of wrong data. In this case, the risk is so high. Instead of enter 'quad4', user can entrer 'qua4'?
The best way is to get all valid type name in Hypermesh and build a GUI script with this list of type name. User is asked just to select an item of list.
Hi
utilize hwtk 'selectlist' to build a GUI
proc ::selectConfigs args { lassign $args btn sl if {$btn in {ok cancel}} { set listConfigs {} if {$btn == 'ok'} { foreach row [$sl selectionget] { lappend listConfigs [dict get [$sl rowcget $row -values] config] } append listConfigs ' ' } [winfo toplevel $sl] unpost set ::selectConfigs $listConfigs } else { set w .selConfigs destroy $w hwtk::dialog $w wm title $w 'Select Configs' #wm protocol $w ... => already set by hwtk set f [$w recess] set sl [hwtk::selectlist $f.sl -stripes 1 -selectmode multiple] pack $sl -fill both -expand 1 $w hide apply $w buttonconfigure ok -command [list ::selectConfigs ok $sl] $w buttonconfigure cancel -command [list ::selectConfigs cancel $sl] $sl columnadd config -text Configs: foreach config $args { $sl rowadd row[incr i] -values [list config $config] } $w post set ::selectConfigs {} tkwait variable ::selectConfigs return $::selectConfigs } } #example: set MySelectedConfigs [selectConfigs rbe3 rigid rigidlink weld rod spring] puts 'Selected configs = $MySelectedConfigs'
Join us for a community conversation on how High-Performance Computing (HPC) and Simcenter PSIM work together to meet the increasing demands of modern power electronics simulation. During this one-hour technical session, you'll discover how leveraging HPC can speed up simulations, improve scalability, and empower engineers…
Join us for a community conversation on accelerating your motor simulation workflow with Simcenter Simlab. In this beginner-friendly session, we'll introduce the platform's automated model-building capabilities and show how easy it is to set up your first electric motor analysis. You'll see the basic steps of geometry…
Join us for a Community Conversation where we'll discuss practical approaches to analyzing complex electromagnetic models using hybrid solver techniques. This session will provide a general overview of how different computational methods can be combined within a single simulation to address models containing varied…