Jump to content

Recommended Posts



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.


        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 Draw    

        hwi CloseStack



please give me some advice. Thank you 

Share this post

Link to post
Share on other sites

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

Share this post

Link to post
Share on other sites

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


Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now