hyperview isolate a component by tcl script
Altair Forum User
Altair Employee
Answers
-
Do what do you want in interactive mode. Then have a look at file 'command.tcl'. You'll found the command for your script.
0 -
and where can I find 'command.tcl'
Is it available for hyperview??
0 -
Sorry, only for Hypermesh.
0 -
I realise this is an old thread, but it's had a lot of views and I have a solution that may benefit future users of HyperView:
proc isolate_comp { comp_id } {# this procedure masks all of the model elements before displaying only the specified component# begin automatic handle trackinghwi OpenStackset ui [expr rand()];# get handles down to model and view levelhwi GetSessionHandle my_session$uimy_session$ui GetProjectHandle my_project$uimy_project$ui GetPageHandle my_page$ui [my_project$ui GetActivePage]my_page$ui GetWindowHandle my_window$ui [my_page$ui GetActiveWindow]my_window$ui GetClientHandle my_client$uimy_window$ui GetViewControlHandle my_view$uimy_client$ui GetModelHandle my_model$ui [my_client$ui GetActiveModel]# mask all partsmy_model$ui MaskAll part# create a temporary selection set of component type, give it a unique label and make sure that it's empty to begin withmy_model$ui GetSelectionSetHandle ssh$ui [my_model$ui AddSelectionSet component]ssh$ui SetLabel "SelectionSet$ui"ssh$ui Clear# making the select mode "all" allows hidden entities to be selectedssh$ui SetSelectMode all# add the specified component id to the selection setssh$ui Add "component $comp_id"# unmask selected set, fit the view and redrawset tempsetnum [ssh$ui GetID]my_model$ui UnMask $tempsetnummy_view$ui Fitmy_page$ui Draw# remove the temporary selection set, leaving the component elements displayedmy_model$ui RemoveSelectionSet [ssh$ui GetID]# release handlesssh$ui ReleaseHandlemy_model$ui ReleaseHandlemy_view$ui ReleaseHandlemy_client$ui ReleaseHandlemy_window$ui ReleaseHandlemy_page$ui ReleaseHandlemy_project$ui ReleaseHandlemy_session$ui ReleaseHandlehwi CloseStack}# this is the line to set the component id number that will be isolated:set component_id_number 2# this is the line to call the procedure that will isolate the specified component:isolate_comp $component_id_number0