[DesignModeler] error when running the *.js script file?

EhsanBa
EhsanBa Member Posts: 15
Name Dropper First Comment
**

Hi,
I'm a newbie to DM scripting. I'm doing an optimization project over a blade and need to update the computational domain in a specified interval. Only one single curve (the blade profile) must be re-imported from a new coordinate file.
As far as I know, I only need to put this line in a free *.js file:

agb.Regen();

However, when I ran the file, I got this error:

What should I do?

Any ideas would be greatly appreciated.

(Note: SpaceClaim is not gonna work for me, because I'm meshing in 2D, and SpaceClaim doesn't preserve the blade curve when it sends the geometry to the Ansys Meshing, so the mesh cannot capture the curvature appropriately)

Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 382
    25 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    js scripting is not supported and generally not recommended. Are you trying to import only a single curved line from a file with XYZ coordinates?

    Discover can import a curve like this, or Mechanical can also create line bodies with API scripting.

    If you can provide more info about the data input and the workflow objectives perhaps more you can get more advice.

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 347
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    I could not reproduce the issue. Error message says that first character is invalid. It is probably an encoding issue. Are you using File > Run Script... to run script?

  • EhsanBa
    EhsanBa Member Posts: 15
    Name Dropper First Comment
    **

    @Mike.Thompson
    Thanks for your reply. I didn't know that it was not supported.

    Yes, only a single curve as a coordinate file should be imported using the 3D curve module.

    The coordinate file should be updated during the optimization and then the curve must be updated. I'm trying to do this with the "agb.Regen();" command.

  • EhsanBa
    EhsanBa Member Posts: 15
    Name Dropper First Comment
    **

    @Landon Mitchell Kanner
    Thanks for your reply.
    Yes, I'm trying to run the script by File > Run Script