How can I add Pre-Test Calculator (NVH Toolkit) and Export Sensor location UNV file?
Tested with 2024R2.
ns_faces
# Analysis modal = Model.Analyses[0] pt = modal.CreatePostObject("PreTestTreeObject", "NVHToolkit") # Get faces named selection ns_type = Ansys.ACT.Automation.Mechanical.NamedSelection all_face_objs = ExtAPI.DataModel.GetObjectsByName("faces") ns_faces = filter(lambda x: (x.GetType() == ns_type), all_face_objs)[0] # Populate PT Tree Object face_sel = ExtAPI.SelectionManager.CreateSelectionInfo( SelectionTypeEnum.GeometryEntities) face_sel.Ids = ns_faces.Ids pt.Properties["Geometry/DefineBy/Geo"].Value = face_sel # Set distance between nodes pt.Properties["FilterNodesDistance"].Value = 30 # Proximity between sensors pt.Properties["SensorDefinition"].Properties["ProximityBetweenSensors"].Value = 35 # Set Max Sensors pt.Properties["SensorDefinition"].Properties["MaximumNumberSensors"].Value = 20 pt.Properties["FilterNodesDistance"].Validate() # Evaluate pt.NotifyChange() modal.Solution.EvaluateAllResults() # Export UNV File nvh_tool = ExtAPI.ExtensionManager.GetExtensionByName("NVHToolkit") # Set sensor and exciter file name including path. nvh_tool.Attributes["exportdir"] = r"\Path\to\exported\file" nvh_tool.ScriptScope.PT_PANES["Pre-Test Worksheet"].ExportUNV(pt)