How to create the shaft geometry in Ansys Motion using scripting?

Options
Vishnu
Vishnu Member, Employee Posts: 212
Name Dropper First Anniversary Solution Developer Community of Practice Member First Comment
edited September 2023 in Structures

Answers

  • Vishnu
    Vishnu Member, Employee Posts: 212
    Name Dropper First Anniversary Solution Developer Community of Practice Member First Comment
    Options
    import os
    ansys_motion_objects = Model.Analyses[0].GetUserObjects("ANSYSMotion")
    shaft_obj = filter(lambda x: x.Name == "Shaft", ansys_motion_objects)[0]
    extension_path = ExtAPI.ExtensionManager.GetExtensionByName('ANSYSMotion').InstallDir
    dll_path = os.path.join(extension_path,"dll","ANSYSMotion.dll")
    clr.AddReferenceToFileAndPath(dll_path)
    import ANSYSMotionHelper
    ANSYSMotionHelper.DrivetrainCallbackClass.ImportDTGeometry(shaft_obj)