Where can I find the documentation?

Options

This forum is very helpful for many things. For example, one snippet of code I found here helped me increase the font size of the legend text. In the code, I found this snippet:

ds = ExtAPI.DataModel.InternalObject["ds"]
ds.Graphics.SetFontStyle(...)

Naturally, I want to know what else the SetFontStyle function does, but I have found nowhere that lists other capabilities or how to use it. Can someone tell me where to find this and more? For example, does it also have the ability to set the font to bold? I am looking for a listing of these functions and others so I don't have to hope someone has posted a code snippet here. I also want to know other ways to use the ExtAPI but I can't find that one either.

Thanks

Tagged:

Answers

  • Figeneer
    Figeneer Member Posts: 5
    Name Dropper First Comment
    **

    I should have included: I need documentation for 2023 R1, because that is what I am using. Thanks.

  • James Derrick
    James Derrick Administrator, Employee Posts: 379
    Ancient Membership 100 Comments 100 Likes 25 Answers
    admin

    Hi @Figeneer great question! I think the @Structures-Scripting-Team should be able to help you although i suspect the docs can be found amongst your Mechanical documentation. Where have you already looked?

  • Figeneer
    Figeneer Member Posts: 5
    Name Dropper First Comment
    **

    @James Derrick said:
    Hi @Figeneer great question! I think the @Structures-Scripting-Team should be able to help you although i suspect the docs can be found amongst your Mechanical documentation. Where have you already looked?

    I looked with Google. For example, this returns 4 results that are not of much use to me:

    ANSYS "ExtAPI.DataModel" legend font Bold

    I also searched the documentation but I only see examples of the use of some things but no explanation of what else is possible with those things. For example, this search.

    What I would like to see is somewhere that explains what the methods or functions of each parameter are. For example, I have seen this ExtAPI used in many examples:

    ExtAPI.DataModel
    ExtAPI.SelectionManager
    ExtAPI.Application

    But nowhere that says like this:

    ExtAPI can have DataModel that does XYZ. (and then what can come after DataModel, etc.)
    ExtAPI can have SelectionManager that does XYZ. (then what can come after SelectionManager, etc.)
    ExtAPI can have Application that does XYZ. (then what can come after Application, etc.)

    Right now, I am only able to sort of gather what ExtAPI does by looking at examples others have written. Another example:

    ds = ExtAPI.DataModel.InternalObject["ds"]
    ds.Graphics.SetFontStyle

    Ok, but what else can ds.Graphics do? Can it set the font to bold? How? Where is there a listing of the methods (like SetFontStyle) that Graphics can call?

    Thanks!

  • Jimmy He
    Jimmy He Member, Employee Posts: 28
    10 Comments 5 Likes First Answer First Anniversary
    ✭✭✭✭

    Hi @Figeneer , you can check out the Mechanical scripting API doc here:
    https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v251/en/act_script/act_script.html

    Besides looking at the doc, you can also leverage the auto-complete capability in the Mechanical scripting window to understand the available methods:

    Finally, you can get a list of all available methods and attributes for an object using "dir":