How can I retrieve a Design Point number in a Mechanical simulation?
Pierre Thieffry
Member, Moderator, Employee Posts: 107
✭✭✭✭
One of our customers wants to export a file for each DP with the filename indicating the DP number . How can I retrieve this information?
Tagged:
0
Answers
-
Here's how I did it - the customer wanted to export Equivalent Radiated Power Level
erpl_result=ExtAPI.DataModel.GetObjectsByName('Equivalent Radiated Power Level')[0] analysis=erpl_result.Parent.Parent # Analysis could be retrieved differently dp_id=analysis.WorkingDir.split('\')[-4] # dp number appears in WorkingDir. Simply splitting by / user_files_dir=os.path.join(analysis.WorkingDir,'../../../user_files') file_name=os.path.join(user_files_dir,'erpl_'+dp_id+'.txt') # Filename with dp number erpl_result.ExportToTextFile(file_name)
2