CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS (https://www.cfd-online.com/Forums/ansys/)
-   -   Scripting Designmodeler - create skin out of line bodies - named selection (https://www.cfd-online.com/Forums/ansys/153187-scripting-designmodeler-create-skin-out-line-bodies-named-selection.html)

USER1234 May 20, 2015 02:40

Scripting Designmodeler - create skin out of line bodies - named selection
 
Hi,

I'm writing a Script (with MATLAB) for Ansys Designmodeler to get a volume of a complex tooth geometry. I've imported a cloud of Points and created Line Bodies from this Points.
The Points define two tooth flanks. Every flank has the same number of Points and is mirrored.
Now I want to use the Skin/Loft to get a Volume. In the Ansys Help I could find the Scripting for Skin/Loft:

Quote:

//Create Skin from sketches in 4 offset planes var
Skin1 = agb.Skin(agc.Add, agc.No, 0.0, 0.0);
Skin1.Name = "Point2OvalSkin"
Skin1.AddBaseObject(ps1.Sk1);
Skin1.AddBaseObject(ps2.Sketch2);
Skin1.AddBaseObject(ps3.Sketch3);
Skin1.AddBaseObject(ps4.Sketch4);
agb.Regen(); //To insure model validity
The problem is, that Designmodeler crashes when I AddBaseObject(Line Body) - Code is this:

Quote:

var Skin1 = agb.Skin(agc.Add, agc.No, 0.0, 0.0);
Skin1.Name = "Line2Skin"
for (var i = 0; i < ag.fm.BodyCount; i+=2)
{
var f1=ag.fm.body(i);
Skin1.AddBaseObject(f1);
}
agb.Regen();
I found out, that "skin.AddBaseObject()" needs an edge, a sketch or a named selection.

Now my question:
Can somebody help me and give me a hint how to write script for named selection of line bodies. It would be usefull not to just give me the code - please explain to me what to do - i want to understand what I'm doing!

I want to skin each "mirrored" Line Body ...

Best regards

Max


All times are GMT -4. The time now is 13:03.