How to import plot style in hyperview using Tcl Command

sanket_patil
sanket_patil Altair Community Member
edited January 2022 in Community Q&A

Hello All,

Can anyone suggest me the tcl command to import plot styles in hyperview?

Thanks in advance.

Regards,

Sanket Patil

Answers

  • Adriano_Koga
    Adriano_Koga
    Altair Employee
    edited January 2022

    Please take a look at the RestorePlotStyle API, under the Contour Control Class.

    Probably you're looking for this:

    image

    poIContourCtrl RestorePlotStyle

    Resets the contour controller settings with a memorized plot style.

    Syntax

    poIContourCtrl_handle RestorePlotStyle style_name

    Application

    HyperView Tcl Modify

    Description

    This command updates the contour controller settings with the new settings specified by the plot style name.

    Inputs

    style_name
    The name of the plot style.

    Example

    To restore a contour plot style:
    hwi OpenStack hwi GetSessionHandle session_handle 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 client_handle GetModelHandle model_handle [client_handle GetActiveModel] model_handle GetResultCtrlHandle result_handle result_handle GetContourCtrlHandle contour_handle contour_handle RestorePlotStyle style_name hwi CloseStack

     

     

    image

  • sanket_patil
    sanket_patil Altair Community Member
    edited January 2022

    Please take a look at the RestorePlotStyle API, under the Contour Control Class.

    Probably you're looking for this:

    image

    poIContourCtrl RestorePlotStyle

    Resets the contour controller settings with a memorized plot style.

    Syntax

    poIContourCtrl_handle RestorePlotStyle style_name

    Application

    HyperView Tcl Modify

    Description

    This command updates the contour controller settings with the new settings specified by the plot style name.

    Inputs

    style_name
    The name of the plot style.

    Example

    To restore a contour plot style:
    hwi OpenStack hwi GetSessionHandle session_handle 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 client_handle GetModelHandle model_handle [client_handle GetActiveModel] model_handle GetResultCtrlHandle result_handle result_handle GetContourCtrlHandle contour_handle contour_handle RestorePlotStyle style_name hwi CloseStack

     

     

    image

    Hello @Adriano A. Koga,

    Thanks for guiding me.

    I have one piece of code as below,

    hwi OpenStack
    set t [::post::GetT];
    hwi GetSessionHandle sessh$t
    sessh$t GetProjectHandle ph$t
    ph$t GetPageHandle pgh$t [ ph$t GetActivePage]
    pgh$t GetWindowHandle wh$t [pgh$t GetActiveWindow]
    wh$t GetClientHandle ch$t
    ch$t GetModelHandle modH$t [ch$t GetActiveModel]
    modH$t GetResultCtrlHandle anim$t
    anim$t GetContourCtrlHandle result$t
    result$t GetCurrentPlotStyle
    set psList [result$t GetPlotStyleList]
    result$t RestorePlotStyle "C:/Program Files/Altair/2019/hw/prefinc/post_styles.xml"
    hwi CloseStack

    I am trying to import the post_styles.xml file but it is not loading in model. Can you help to resolve the issue. 

    image

    Thanks in advance.

    Regards,

    Sanket Patil

  • sanket_patil
    sanket_patil Altair Community Member
    edited January 2022

    Hello @Adriano A. Koga,

    Thanks for guiding me.

    I have one piece of code as below,

    hwi OpenStack
    set t [::post::GetT];
    hwi GetSessionHandle sessh$t
    sessh$t GetProjectHandle ph$t
    ph$t GetPageHandle pgh$t [ ph$t GetActivePage]
    pgh$t GetWindowHandle wh$t [pgh$t GetActiveWindow]
    wh$t GetClientHandle ch$t
    ch$t GetModelHandle modH$t [ch$t GetActiveModel]
    modH$t GetResultCtrlHandle anim$t
    anim$t GetContourCtrlHandle result$t
    result$t GetCurrentPlotStyle
    set psList [result$t GetPlotStyleList]
    result$t RestorePlotStyle "C:/Program Files/Altair/2019/hw/prefinc/post_styles.xml"
    hwi CloseStack

    I am trying to import the post_styles.xml file but it is not loading in model. Can you help to resolve the issue. 

    image

    Thanks in advance.

    Regards,

    Sanket Patil

    Hello All,

    Any suggestions on this?

    Regards,

    Sanket