TAGGED: #python-#ironpython, Ansys Discovery
-
-
February 25, 2026 at 4:40 pm
mihir.samel
SubscriberI am working on a series of Discovery scripting functions. Right now we are including those in every *.dscript session in order to reuse them for each application. Hence I wish to save them as a module at a path : C:\Work\modules\myColor.py. In this class I have one method which seeks to call some Discovery API
like part = GetRootPart().GetAllBodies()
> global name 'GetRootPart' is not definedThe trouble I am facing is that these APIs are not recognized as the class is saved in C:\Work\modules . I am unable to save it in
C:\Program Files\ANSYS Inc\v251\Discovery\Library\IronPython\Libdue to IT admin policy . What is the workaround here? I can prove that the module is successfully imported in the *.dscript as by using a simple print("Hello") command in the function of my module.ÂIs there anything I could do to help this? I can upload a .dscript and .the *.py moduleÂ
-
- You must be logged in to reply to this topic.
-
5194
-
1859
-
1387
-
1250
-
1021
© 2026 Copyright ANSYS, Inc. All rights reserved.