Jump to content
Toan Nguyen

HyperView customiztion

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

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.



Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...