How to set Mechanical preferences with Python script ?

Jean
Jean Member Posts: 22
10 Comments Name Dropper
**

Hi,

I would like to create an ACT button for defining some setting.
Now, I create this function :

    def reglages_WB(analysis):
        """
        TBD
        """
        SetPreferenceValue("GraphicsBackgroundColor","255 255 255 255")
        SetPreferenceValue("Language","fr")
        SetPreferenceValue("ShowBetaOptions","True")
        SetPreferenceValue("ACT_AdditionalExtensionsFolders","D:\\ANSYS_ADD-ON\\0_Extensions\\")
        SetPreferenceValue("ACT_DebugMode","True")
        MessageBox.Show("Reglages : ok")

But I don't find a way to add these setting :

  • Set the licence order preference
  • Remove the ruler in the model window
  • Add some shortcut button (eg. Figure)
  • ...

Someone know the Python command to do that ?

Thanks,
Jean

Answers

  • AlexGh
    AlexGh Member Posts: 12
    First Comment Name Dropper
    **

    Hello Jean!

    Remove the ruler in the model window

    DS = ExtAPI.DataModel.InternalObject["ds"]
    DS.Graphics.RulerVisibility = 0
    DS.Graphics.Refresh()