# 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/ def getConditionsSpecifiedType(targetStudy, typeName): """Get specified type conditions applied to the target study""" matches = [] numConds = targetStudy.NumConditions() for i in range(numConds): condition = targetStudy.GetCondition(i) CondType = condition.GetScriptTypeName() if CondType == typeName: matches.append(condition) return matches def checkRotationMotionPropertyValues(conditions): """Print some properties and values of rotation motion conditions""" for cond in conditions: if cond.GetScriptTypeName() == u"RotationMotion": print(cond.GetType(), u"; name:", cond.GetName(), u"; Applied parts IDs", cond.GetParts()) proplist = conditions[0].GetPropertyNames() for name in proplist: if name == u"AngularVelocity": print(cond.GetPropertyHelp(name), u":", cond.GetValue(name)) elif name == u"MotionGroupType": print(cond.GetPropertyHelp(name), u":", cond.GetFlagAsString(name)) print(u"") app = designer.GetApplication() conditions = getConditionsSpecifiedType(app.GetCurrentStudy(), u"RotationMotion") if len(conditions) <= 0: print(u"Specified condition is not found.") else: checkRotationMotionPropertyValues(conditions)