Replies: 1 comment
-
Hello koubaa, @koubaa I tried your approach in Discussion: #1035, still show error by importing module, any suggestions on it? import clr (ModuleNotFoundError: No module named 'ANSYSMotionHelper') |
Beta Was this translation helpful? Give feedback.
-
Hello All,
I would like to import a module to use call back function for ANSYSMotion.
Refer to : https://discuss.ansys.com/discussion/2384/how-to-create-the-shaft-geometry-in-ansys-motion-using-scripting
by import I face error, any idea what is the error reason or any suggestion to realize it:
ModuleNotFoundError: No module named 'ANSYSMotionHelper'
get module path
extension_path = r'D:\Program Files\ANSYS Inc\v251\aisol\WBAddins\MechanicalExtensions\ANSYSMotion\dll' #ExtAPI.ExtensionManager.GetExtensionByName('ANSYSMotion').InstallDir
dll_path = os.path.join(extension_path,"ANSYSMotion.dll")
exchange AddReferenceToFileAndPath -> AddReference (AddReferenceToFileAndPath seems not available in python)
#clr.AddReferenceToFileAndPath(dll_path) # iornpython not working in python
sys.path.append(dll_path)
clr.AddReference("ANSYSMotion")
import ANSYSMotionHelper
ANSYSMotionHelper.DrivetrainCallbackClass.ImportDTGeometry(shaft_obj)
Beta Was this translation helpful? Give feedback.
All reactions