# 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 createScaling(study, param): """Set the magnification to apply to the plot (scale setting)""" scaFac = study.CreateScaling(param[u"title"]) scaFac.SetScalingFactor(param[u"scalingFactor"]) def createVector(study, paramVector): """Create a vector plot with scale applied and configure the display settings.""" vectorDefinition = study.CreateVector(paramVector[u"title"]) vectorDefinition.SetResultType(paramVector[u"resultType"]) vectorDefinition.SetPlace(paramVector[u"place"]) vectorDefinition.SetViewScale(paramVector[u"viewScale"]) vectorDefinition.SetScalingFactor(paramVector[u"scalingFactor"]) # display type # 0:Shaded # 1:Hidden Line # 2:Wireframe vectorDefinition.SetDisplayType(paramVector[u"displayType"]) vectorDefinition.SetViewOriginalModel(paramVector[u"viewOriginalModel"]) study = app.GetCurrentStudy() paramScale = { u"title" : u"SingleScale", u"scalingFactor" : 1.25 } createScaling(study, paramScale) paramVector = { u"title" : u"DispVecSingleScale", u"resultType" : u"Displacement", u"place" : u"SurfaceNodes", u"viewScale" : True, u"scalingFactor" : study.GetPostCondition(paramScale[u"title"]), u"displayType" : 2, u"viewOriginalModel" : True } createVector(study, paramVector) # Turn on the display of the vector result. view = app.View() view.SetVectorView(True)