CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS Meshing & Geometry (https://www.cfd-online.com/Forums/ansys-meshing/)
-   -   [DesignModeler] Create Skin from Curves by a JScript (https://www.cfd-online.com/Forums/ansys-meshing/113782-create-skin-curves-jscript.html)

Red February 26, 2013 11:16

Create Skin from Curves by a JScript
 
Hello,


I found this forum by searching a solution for a certain problem and I hope somebody here might help.

I want to create a geometry in the DesignModeler totaly by using a JScript. I already succeeded in creating most of the parts, but I got stuck by creating a Skin from some curves, which I defined.

The part where the curves and the skin shall be created looks like this:

Code:

var myCurve = ag.gui.CreateCurve();

// Read Curves from File
myCurve.FCurveDefType = 1;
   
myCurve.CoordinateFile = "curve_file.txt";
myCurve.Name = "my_curve";
myCurve.CurveRefresh = 1;

// ... and now create the skin ...

This part works fine. Now I'm trying to select the Curves and to create the skin. I managed to create a new skin and I can add the line bodys to it, but the creation fails with an error (it says, that the types are not valid).

Here is what I tried (Body 8 to 12 are the line bodys):

Code:

ag.b.Regen();
var mySkin = ag.b.Skin(agc.Add, agc.Yes, 0.0, 0.0);
mySkin.AddBaseObject(ag.agApplet.FeatureMgr.Body(8));
mySkin.AddBaseObject(ag.agApplet.FeatureMgr.Body(9));
mySkin.AddBaseObject(ag.agApplet.FeatureMgr.Body(10));
mySkin.AddBaseObject(ag.agApplet.FeatureMgr.Body(11));
mySkin.AddBaseObject(ag.agApplet.FeatureMgr.Body(12));
ag.b.Regen();

I guess, that I have to select the edges instead of the line bodys, but I don't know how I can do that. May be someone here nows a solution? It would be a great help ...


Thank you very much!


Best regards
Red


All times are GMT -4. The time now is 14:36.