Questions about mechanical scripting sizing settings


Hello!
As shown in the picture above, I used mechanical scripting to set a sizing option, but I don't know how to use mechanical scripting to turn on Capture Curvature and Capture Proximity.

Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 241
    First Anniversary First Comment 5 Likes Ansys Employee

    Have you tried recording your actions from the UI to see the API generated?

  • SSR
    SSR Member Posts: 3
    Name Dropper First Comment

    @Mike.Thompson said:
    Have you tried recording your actions from the UI to see the API generated?

    I have tried this before, but the recording did not generate the corresponding code. To be precise, there was no response.

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 241
    First Anniversary First Comment 5 Likes Ansys Employee

    I don’t know off hand the API syntax, but do a dir(MySizingObj) function on your object and list all the properties of it. You can read through them.
    If that doesn’t work also do this on: dir(MySizingObj.InternalObject)

    python dir is a great function to see everything available on an object.

  • SSR
    SSR Member Posts: 3
    Name Dropper First Comment

    @Mike.Thompson said:
    I don’t know off hand the API syntax, but do a dir(MySizingObj) function on your object and list all the properties of it. You can read through them.
    If that doesn’t work also do this on: dir(MySizingObj.InternalObject)

    python dir is a great function to see everything available on an object.

    Thank you very much for your suggestion. I looked at the operation manual and it did not mention that the sizing module sets the Capture Curvature and Capture Proximity function. Is it because there is no way to automatically realize the functions I mentioned above?

  • M
    M Member, Employee Posts: 199
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    edited January 24

    @SSR
    Look under the properties of your edge sizing control.

    edgeSize0 = ExtAPI.DataModel.GetObjectsByName('Edge Sizing')[0]
    esp = edgeSize0.Properties
    dir(esp)
    edgeSize0.PropertyByName('SizingCurvatureAngle')