Referencing scriptable extension using the command

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, GitHub-issue-creator Posts: 315
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    Answer ✓
    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