HyperView customiztion
Hi,
I am trying o write a script in HyperView.
My problem is I don't know how to plot the legend.
Below is my current code. I am able to apply displacement result on model but the legend doesn't show up.
clear
hwi OpenStack
hwi GetSessionHandle session_handle
session_handle New
session_handle GetProjectHandle project_handle
project_handle GetPageHandle page_handle [project_handle GetActivePage]
page_handle GetWindowHandle window_handle [page_handle GetActiveWindow]
window_handle GetClientHandle client_handle
# load model #
client_handle AddModel 'D:/P-optistruct/rs/OS-1050/dissimilar.h3d'
client_handle GetModelHandle model_handle [client_handle GetActiveModel]
client_handle SetDisplayOptions 'contour' true
model_handle SetResult 'D:/P-optistruct/rs/OS-1050/dissimilar.h3d'
model_handle GetResultCtrlHandle result_handle
result_handle GetContourCtrlHandle contour_handle
contour_handle SetEnableState true
contour_handle SetDataType 'Displacement'
contour_handle GetDataType
contour_handle GetLegendHandle legend_handle
legend_handle SetDefaultState True
legend_handle SetPosition upper left
client_handle Draw
window_handle Drawhwi CloseStack
please give me some advice. Thank you
Answers
-
Hi Toan,
You need the following statement as well:
client_handle SetDisplayOptions 'legend' true
0 -
Thank you.
I am also trying to create a GUI. I used 'Keepontop' to keep the GUI window appear even when I switch to another program. This command works in HM but not in HV.
Could you please show me another way to do this
0 -
Hi,
use ::hwt::KeepOnTop
in hypermesh the proc KeepOnTop is pushed to global ns
0 -
Thank you very much
0 -
One more question. I am also trying to write macro for HyperGraph 2D.
I can not execute the command 'SelectYComponent' to select Component for graph.
Below is my code.
Please give me any advice:\
set file_path 'D:/P-optistruct/rs/OS-1050/dissimilar.h3d' hwi OpenStack hwi GetSessionHandle session_handle session_handle New session_handle GetProjectHandle project_handle session_handle GetClientManagerHandle plot_manager Plot project_handle GetPageHandle page_handle [project_handle GetActivePage] page_handle GetWindowHandle window_handle_2 1 page_handle SetActiveWindow 1 window_handle_2 SetClientType Plot window_handle_2 GetClientHandle client_handle_2 plot_manager GetBuildPlotsCtrlHandle build_plot build_plot SelectDataFile '$file_path' build_plot GetActiveFilename build_plot SetXDatatype 'Time' build_plot SetYDatatype 'Displacement' build_plot SelectYRequests {'N5'} build_plot GetComponentList 'True' build_plot SelectYComponent {'X' 'Y' 'Z' 'MAG'} build_plot GeneratePlots client_handle_2 Draw hwi CloseStack
0 -
Hi Toan,
You can give multiple components, so the statement below is correct.
build_plot SelectYComponents {'X' 'Y' 'Z' 'MAG'}
Please give it a try.
0 -
Hello Toan,
I am also trying to write macro for HyperGraph 2D with your script you mentioned above, But I'm not able to get output.
Have you succeed in your script?
Please give me advice.
Thanks,
0