Issues with changing the coordinate system in a "user define results" plot.


Hi guys :)

I am looking into changing the CoordinateSystem field of a User defined plot in a script from "Global coordinate system" to "Solution Coordinate System" but have hit a wall. The macro recorder does not record any changes and the Plot.CoordinateSystem parameter can only accept objects of type coordinate system! How can I find a quick way for this change?

Any help in this regard will be much appreciated :)

Best Answer

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 804
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓

    Hi @Kev , this is not intuitive, but if you set the CS to "None", you'll get the Solution CS:

    normal_stress = DataModel.GetObjectsByType(Ansys.ACT.Automation.Mechanical.Results.StressResults.NormalStress)[0]
    normal_stress.CoordinateSystem = None


  • Kev
    Kev Member Posts: 41
    First Anniversary 5 Likes First Comment Name Dropper

    Hi @Pernelle Marone-Hitz . Thanks again for your prompt help!

    I should have known it was something along those lines as when I assigned the plot.CoordinateSystem to a variable and queried different attributes I'd get an error like " NoneType object has no attribute .... " .

    Thanks a million again Prenelle :)