# 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 createProbeByCoordinate(study, resultType, component): """Create a probe of the result type specified by the argument""" probeDefinition = study.CreateProbe(resultType) probeDefinition.SetResultType(resultType) # The 1st argumet of SetResultCoordinate # Name or index # The name of the preset coordinate system is fixed according to the language setting. # The index is specified in a 0-based from the coordinate system definition list order under Project - Model - Coordinate Systems probeDefinition.SetResultCoordinate(0) # probeDefinition.SetResultCoordinate(u"Global Rectangular") probeDefinition.SetComponent(component) probeDefinition.SetProbeType(u"Coordinate") probeDefinition.SetLocationCoordinate(0) # probeDefinition.SetLocationCoordinate(u"Global Rectangular") probeDefinition.RenamePoint(0, u"PointA") probeDefinition.SetLocation(0, u"30", u"200", u"0") probeDefinition.AddLocation(u"50", u"150", u"0", u"PointB") probeDefinition.SetMoveWithPart(True) def createVectorWithAllParts(study, resultType): """Create a vector plot of the specified result type for all components""" vectorDefinition = study.CreateVector(resultType) vectorDefinition.SetResultType(resultType) vectorDefinition.SetStyle(u"SimpleCone") vectorDefinition.SetScaled(True) vectorDefinition.SetPlace(u"FaceCenter") vectorDefinition.SetVectorType(0) vectorDefinition.SetNumSkips(u"2") vectorDefinition.SetDisplayAllParts(True) def createContourWithAllParts(study, resultType, component): """Create a contour plot of the specified result type for all parts""" contourDefinition = study.CreateContour(resultType) contourDefinition.SetResultType(resultType) contourDefinition.SetResultCoordinate(0) # contourDefinition.SetResultCoordinate(u"Global Rectangular") contourDefinition.SetComponent(component) contourDefinition.SetContourType(u"Shading") contourDefinition.SetDisplayAllParts(True) app = designer.GetApplication() study = app.GetCurrentStudy() resultType = u"ContactForce" component = u"X" createProbeByCoordinate(study, resultType, component) resultType = u"FacePressure" createVectorWithAllParts(study, resultType) resultType = u"PlasticStrain" component = u"Y" createContourWithAllParts(study, resultType, component)