# Copyright (c) 2026 JSOL CORPORATION # # This script is released under the MIT License. # See the full license text at: # https://www.jmag-international.com/scriptlibrary/jmag_script_library_mit/ app = designer.GetApplication() def create2DHarmonicAmplitudeResponseValueFromSectionGraph(study, sectionName, responseVarName, calcTimeRange): """Create 2D harmonic amplitude response value ​​based on the section graph""" parameter = app.CreateResponseDataParameter(sectionName) parameter.SetCalculationType(u"2DHarmonic") parameter.SetHarmonic(u"1") parameter.SetPeriodicity(u"Half") parameter.SetSpaceHarmonic(u"1") parameter.SetSpacePeriodicity(u"Half") parameter.SetVariable(responseVarName) # The 1st argumet of SetCaseRangeType # 0:Uses all steps in all cases # 1:Uses same value for all cases # 2:Specifies values for each case # 3:interval specified from the final step for all cases parameter.SetCaseRangeType(1) parameter.SetStartValue(calcTimeRange[0]) parameter.SetEndValue(calcTimeRange[1]) study.CreateParametricDataFromSection(sectionName, parameter) sectionName = u"SectionArc" responseVarName = "Harmonic2D" calcTimeRange = [u"0.0001", u"0.0003"] study = app.GetCurrentStudy() create2DHarmonicAmplitudeResponseValueFromSectionGraph(study, sectionName, responseVarName, calcTimeRange)