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.
Hi all,
Is it possible to create a custom toolbar in Hyperview?
I know it is possible in Hypermesh using the CreateMinibar command. I am looking for similar option in Hyperview.
Hi Vipin,
there is a command can be used to make hyperview toolbar, '::hw::HwToolbar'
but unlucky, it is not documented!
outer wrapping command is ::hwtb::toolbar but it seems to be not completed (please check it with HW2020, i don't have this version)
If aboves are not applicable, you can easily make your own toolbar, using ::hwtk::toolbutton to create toolbar buttons, and pack them in a frame, finally pack the frame (toolbar) on HV GUI
Do not pack your own toolbar on HV dock frames because they are handled by HV GUI mechanism,
pack your toolbar in HV center frame, example:
proc mytoolbar {name items} { if {[regexp -nocase {^[a-z 0-9_]$} $name]} { return -code error "invalid toolbar name '$name'. Should contains only a-z, 0-9, _" } set tbw ._Tb_[string map {" " ""} $name] if {![winfo exists $tbw]} { frame $tbw pack $tbw {*}[pack info .mainFrame.center.f3.topMessageBar] -before .mainFrame.center.f3.topMessageBar } eval destroy [winfo child $tbw] pack [label $tbw.hdl -image classicToolbarHandleVertical.png -compound left] -side left -anchor w foreach item $items { ::hwtk::[lindex $item 0] $tbw.item[incr i] {*}[lrange $item 1 end] pack $tbw.item$i -side left -anchor w } } #example: foreach imageFile {entityElementsRigidSliding-24.png entityElementsRod-24.png entityElementsSpring-24.png entityElementsTetra4-24.png} { set imageFile [::hwt::CacheImage $imageFile] } proc action args {tk_messageBox -title "My Toolbar" -message $args} mytoolbar "New Toolbar" { {toolbutton -image entityElementsRigidSliding-24.png -command {action entityElementsRigidSliding-24.png}} {toolbutton -image entityElementsRod-24.png -command {action entityElementsRod-24.png}} {toolbutton -image entityElementsSpring-24.png -command {action entityElementsSpring-24.png}} {toolbutton -image entityElementsTetra4-24.png -command {action entityElementsTetra4-24.png}} }
tested on HV 2019:
I'm not aware of such command for HM, but in the attached PDF you find some hints on creating a 'Preference' File that you could load into your HV session and add a custom menu like this:
Hi @Adriano Koga
It doesn't exactly solve my issue, anyway thank you for sharing this document
Hi Vipin, there is a command can be used to make hyperview toolbar, '::hw::HwToolbar' but unlucky, it is not documented! outer wrapping command is ::hwtb::toolbar but it seems to be not completed (please check it with HW2020, i don't have this version) If aboves are not applicable, you can easily make your own toolbar, using ::hwtk::toolbutton to create toolbar buttons, and pack them in a frame, finally pack the frame (toolbar) on HV GUI Do not pack your own toolbar on HV dock frames because they are handled by HV GUI mechanism, pack your toolbar in HV center frame, example: proc mytoolbar {name items} { if {[regexp -nocase {^[a-z 0-9_]$} $name]} { return -code error "invalid toolbar name '$name'. Should contains only a-z, 0-9, _" } set tbw ._Tb_[string map {" " ""} $name] if {![winfo exists $tbw]} { frame $tbw pack $tbw {*}[pack info .mainFrame.center.f3.topMessageBar] -before .mainFrame.center.f3.topMessageBar } eval destroy [winfo child $tbw] pack [label $tbw.hdl -image classicToolbarHandleVertical.png -compound left] -side left -anchor w foreach item $items { ::hwtk::[lindex $item 0] $tbw.item[incr i] {*}[lrange $item 1 end] pack $tbw.item$i -side left -anchor w } } #example: foreach imageFile {entityElementsRigidSliding-24.png entityElementsRod-24.png entityElementsSpring-24.png entityElementsTetra4-24.png} { set imageFile [::hwt::CacheImage $imageFile] } proc action args {tk_messageBox -title "My Toolbar" -message $args} mytoolbar "New Toolbar" { {toolbutton -image entityElementsRigidSliding-24.png -command {action entityElementsRigidSliding-24.png}} {toolbutton -image entityElementsRod-24.png -command {action entityElementsRod-24.png}} {toolbutton -image entityElementsSpring-24.png -command {action entityElementsSpring-24.png}} {toolbutton -image entityElementsTetra4-24.png -command {action entityElementsTetra4-24.png}} } tested on HV 2019:
Hi @tinh
I tried creating toolbar with '::hw::HwToolbar', but it is quite a difficult task to find the ::hw methods without any documentation.
Your method works for me. Thank you!
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…