Referencing scriptable extension using the command

Options

Hi,

I would like to reference the script extension using the command. Is it possible to add specific extension directory path?

I would like to than load the extension using Extension.LoadExtension…

Tagged:

Best Answer

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 208
    First Answer First Comment 5 Likes First Anniversary
    Answer ✓
    Options
    ScriptedExtensionLocation = r'C:\Users\lmkanner\Downloads\lin_stress_src\src'
    ExtId = "0A0459A2-03BE-4F49-973C-A5459F65E58B".ToLower()
    CurrentLocations = GetPreferenceValue('ACT_AdditionalExtensionsFolders')
    UpdatedLocations = ScriptedExtensionLocation+';'+CurrentLocations
    SetPreference('ACT_AdditionalExtensionsFolders', UpdatedLocations)
    CleanProject()
    Extensions.LoadExtension(Id=ExtId,Format="Scripted")

    Preference IDs can usually be found here:
    {ANSYS Installation folder}\commonfiles\registry\winx64
    In this example, ACT_AdditionalExtensionsFolders can be found in ACTPrefernces.xml in the above folder location.

Answers