How to map 'references' in keyboard shortcuts?
Hi everyone,
does anybody know how to map the references browser panel? For instance, I know that the script for 'Review' is:
::HM_Framework::ToggleReviewFromGraphicsArea
Could you provide something similar for the 'References' command, usually accessible through the right click over an element in the entities tree?
Thanks
Best Answer
-
Ok. I see
just modify a bit and it can works on both Include View & Model View:
proc mbrGetSelectedComps {} { #model browser get selected comps: set results {} foreach tree {.model .fepre_model} { if {[winfo exists $tree]} break } set tree [winfo children $tree._pw._fbr].frmTreeArea.frmTree.__treectrl ....
updated file:
1
Answers
-
Hi Alberto,
This is Wesley. I am an Application Engineer for Altair responding to your question - hopefully I can be of help here.
There is a references browser that can be access by right mouse button on a entity in the model browser and selecting references. This will show all entities that are referenced to that particular entity. See images below.
Is this what you are looking for?
Wesley
0 -
Wesley Castro_21290 said:
Hi Alberto,
This is Wesley. I am an Application Engineer for Altair responding to your question - hopefully I can be of help here.
There is a references browser that can be access by right mouse button on a entity in the model browser and selecting references. This will show all entities that are referenced to that particular entity. See images below.
Is this what you are looking for?
Wesley
Thanks for the reply, but it isn’t what I need. As I wrote in the heading, I need a keyboard shortcut to open the references browser by pressing a button, instead of right clicking with the mouse, as well as I call the review panel pressing ‘Q’ on my keyboard.
I know that I can manually add some shortcuts, but I need the related ‘script’. Something like that one used for ‘Review’ in Q button: ::HM_Framework::ToggleReviewFromGraphicsAreaDo you know how to do that?
0 -
Hi,
try this command:
.model._pw._fbr.content.frmTreeArea.frmTree.__treectrl.popupMenumain invoke "References"
0 -
tinh said:
Hi,
try this command:
.model._pw._fbr.content.frmTreeArea.frmTree.__treectrl.popupMenumain invoke "References"
Hi Tinh,
thank you for your reply, but I'm afraid it doesn't work. I'm showing you how I applied it. Was I wrong?
0 -
Hi,
You have to right click on model browser first (only once), if the context menu has "References" item then the command is available then.
You assign the command to "Keyboard Settings" so it's bound to Graphic Engine key event only (must click graphic area before press your key)
0 -
tinh said:
Hi,
You have to right click on model browser first (only once), if the context menu has "References" item then the command is available then.
You assign the command to "Keyboard Settings" so it's bound to Graphic Engine key event only (must click graphic area before press your key)
Hi,
nice hint, but it seems to be still not working...
Could you provide something else, please? It's obviously not necessary, but it would ease my workflow.
Thank you again for your effort and patience.
0 -
Alberto Perticone said:
Hi,
nice hint, but it seems to be still not working...
Could you provide something else, please? It's obviously not necessary, but it would ease my workflow.
Thank you again for your effort and patience.
It's working on my HM2019
Maybe you have done wrong steps.
check this clip:
0 -
tinh said:
It's working on my HM2019
Maybe you have done wrong steps.
check this clip:
Thank you for the clip, really helpful, but this is the same path I followed and it said:
Do you guess the reason for this?
I'm working with the same version of Hypermesh as yours.
0 -
Alberto Perticone said:
Thank you for the clip, really helpful, but this is the same path I followed and it said:
Do you guess the reason for this?
I'm working with the same version of Hypermesh as yours.
☺
Maybe your hand was dirty !
anyway, try alternative way as in my new post
0 -
Hi,
below code is closer wrapper than 'popupMainmenu invoke Refernences'
Good luck with this time.
proc mbrGetSelectedComps {} { #model browser get selected comps: set results {} set tree .model._pw._fbr.content.frmTreeArea.frmTree.__treectrl foreach item [$tree selection get] { lassign [$tree item ancestors $item] item_type lassign [$tree item text $item_type] item_type_text if {[string match -nocase Components* $item_type_text]} { lassign [$tree item text $item] -> item_id if {[string is integer -strict $item_id]} { lappend results $item_id } } } set results } proc mbrInvokeReferences {} { set CompList [mbrGetSelectedComps] if {[llength $CompList]} { [::hmbr::OperationManager::Instance] perform hmbr::xrefrecursive [list [list Components $CompList]] } } mbrInvokeReferences
You should not put so long script into Keyboard Settings "Command", so
Put it in a file 'InvokeReferences.tcl' (or download attached file),
and point to it from Keyboard Settings "File":
0 -
tinh said:
Hi,
below code is closer wrapper than 'popupMainmenu invoke Refernences'
Good luck with this time.
proc mbrGetSelectedComps {} { #model browser get selected comps: set results {} set tree .model._pw._fbr.content.frmTreeArea.frmTree.__treectrl foreach item [$tree selection get] { lassign [$tree item ancestors $item] item_type lassign [$tree item text $item_type] item_type_text if {[string match -nocase Components* $item_type_text]} { lassign [$tree item text $item] -> item_id if {[string is integer -strict $item_id]} { lappend results $item_id } } } set results } proc mbrInvokeReferences {} { set CompList [mbrGetSelectedComps] if {[llength $CompList]} { [::hmbr::OperationManager::Instance] perform hmbr::xrefrecursive [list [list Components $CompList]] } } mbrInvokeReferences
You should not put so long script into Keyboard Settings "Command", so
Put it in a file 'InvokeReferences.tcl' (or download attached file),
and point to it from Keyboard Settings "File":
That's very kind of you, man! I really appreciate your effort in helping me, but I have to say again that it doesn't work. I don't want to bother you anymore, but I attach what it responds to me when I use your template. (I do click on my component >then press R or click on component >click on hm window > then R. Both of these paths don't work)
Many thanks again, really!
0 -
Alberto Perticone said:
That's very kind of you, man! I really appreciate your effort in helping me, but I have to say again that it doesn't work. I don't want to bother you anymore, but I attach what it responds to me when I use your template. (I do click on my component >then press R or click on component >click on hm window > then R. Both of these paths don't work)
Many thanks again, really!
Don't worry, I think you used Hyperworks Desktop instead of Hypermesh.
Try overwrite your file by this attached:
I modified some codes
proc mbrGetSelectedComps {} { #model browser get selected comps: set results {} foreach tree {.model .fepre_model} { if {[winfo exists $tree]} break } append tree ._pw._fbr.content.frmTreeArea.frmTree.__treectrl foreach item [$tree selection get] { ....
1 -
tinh said:
Don't worry, I think you used Hyperworks Desktop instead of Hypermesh.
Try overwrite your file by this attached:
I modified some codes
proc mbrGetSelectedComps {} { #model browser get selected comps: set results {} foreach tree {.model .fepre_model} { if {[winfo exists $tree]} break } append tree ._pw._fbr.content.frmTreeArea.frmTree.__treectrl foreach item [$tree selection get] { ....
No, I'm using Hypermesh. Now I found out what the problem was. I usually work inside the "includes view" and it doesn't work there.
I have to change to "model view" in order to use your script or I should modify your script for include view.
0 -
Ok. I see
just modify a bit and it can works on both Include View & Model View:
proc mbrGetSelectedComps {} { #model browser get selected comps: set results {} foreach tree {.model .fepre_model} { if {[winfo exists $tree]} break } set tree [winfo children $tree._pw._fbr].frmTreeArea.frmTree.__treectrl ....
updated file:
1 -
tinh said:
Ok. I see
just modify a bit and it can works on both Include View & Model View:
proc mbrGetSelectedComps {} { #model browser get selected comps: set results {} foreach tree {.model .fepre_model} { if {[winfo exists $tree]} break } set tree [winfo children $tree._pw._fbr].frmTreeArea.frmTree.__treectrl ....
updated file:
Unfortunately, It works neither in Model nor in Include View now...
0 -
Alberto Perticone said:
Unfortunately, It works neither in Model nor in Include View now...
I am sorry.
This one should work in Include View:
0 -
tinh said:
Ok. I see
just modify a bit and it can works on both Include View & Model View:
proc mbrGetSelectedComps {} { #model browser get selected comps: set results {} foreach tree {.model .fepre_model} { if {[winfo exists $tree]} break } set tree [winfo children $tree._pw._fbr].frmTreeArea.frmTree.__treectrl ....
updated file:
Yes, It works! Many thanks, man! You gave me your Christmas gift this year.
I wish you a Merry Holy Christmas and happy holidays
0