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

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
-
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.
1 -
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?
1 -
@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.
0