|
[Sponsors] |
May 2, 2018, 08:34 |
Design Modeler scripting
|
#1 |
New Member
Join Date: Oct 2017
Posts: 4
Rep Power: 9 |
Hi all,
I need to automatically create a set of spheres, depending on a list of point coming from an external file. I tried using a .js macro and until now I produce the following: Code:
//Import the points var fp1 = agb.FPoint(agc.FPointConstruction, agc.FPointCoordinateFile); fp1.Name = "coordinatePoints"; fp1.CoordinateFile = "PATH\\file.txt"; agb.Regen(); //Generate spheres according to the sets of points from fp1 above var i = 1; while (fp1.GetPoint(i, 1)) { var SP = ag.gui.CreatePrimitive(1); SP.SphereRadius = "1"; i = i + 1; } agb.Regen();
Can please someone help me or tell me where can I find a list of example and tutorials? Thank you Lorenzo |
|
May 2, 2018, 10:53 |
Solved
|
#2 |
New Member
Join Date: Oct 2017
Posts: 4
Rep Power: 9 |
Sorry, I just solved it:
Code:
//Import the points var fp1 = agb.FPoint(agc.FPointConstruction, agc.FPointCoordinateFile); fp1.Name = "coordinatePoints"; fp1.CoordinateFile = "PATH\\FILE.txt"; agb.Regen(); //Generate spheres according to the sets of points from fp1 above var i = 1; while (fp1.GetPoint(1, i)) { var SP = ag.gui.CreatePrimitive(1); // SP.SphereRadius = "0.00125"; // ag.listview.ActivateItem("Sphere"); ag.listview.ItemValue = "SPHERE_" + i; ag.listview.ActivateItem("Operation"); ag.listview.ItemValue = "Add Frozen"; ag.listview.ActivateItem("Origin Definition"); ag.listview.ItemValue = "Coordinates"; ag.listview.ActivateItem("FD3, Origin X Coordinate"); ag.listview.ItemValue = agb.GetPointX(fp1.GetPoint(1, i)); ag.listview.ActivateItem("FD4, Origin Y Coordinate"); ag.listview.ItemValue = agb.GetPointY(fp1.GetPoint(1, i)); ag.listview.ActivateItem("FD5, Origin Z Coordinate"); ag.listview.ItemValue = agb.GetPointZ(fp1.GetPoint(1, i)); agb.Regen(); // i = i + 1; } |
|
May 19, 2018, 07:21 |
|
#3 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
Hi Lorenzo,
I'm dealing with the same problem, gotta generate a plate with random holes in it and mesh it, all automaticaly using script, would you mind sharing your text file containing the points you used in your script? I wanna generate the points using a code, but not sure yet how I should arrange them inside the text file |
|
May 21, 2018, 06:01 |
|
#4 |
New Member
Join Date: Oct 2017
Posts: 4
Rep Power: 9 |
||
May 22, 2018, 05:33 |
|
#5 | |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
Quote:
got it, thanks |
||
Tags |
design modeler, javascript, scripting |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Connecting 3D bodies in Ansys Design Modeler | chipper | ANSYS Meshing & Geometry | 4 | January 25, 2018 10:45 |
parametric study with design modeler and icepak | aminem | ANSYS | 3 | May 21, 2014 06:11 |
Scripting API Design Modeler - Spline | mieszko1st | ANSYS Meshing & Geometry | 3 | March 3, 2014 06:09 |
Design Modeler not working | tan v | ANSYS | 0 | July 7, 2011 03:43 |
Info: Short Course On Thermal Design of Electronic Equipment | Arnold Free | Main CFD Forum | 0 | August 10, 1999 11:18 |