|
[Sponsors] |
[DesignModeler] Define a new point in a script |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 25, 2015, 18:43 |
Define a new point in a script
|
#1 |
Member
NC
Join Date: Jan 2015
Posts: 49
Rep Power: 11 |
Is there a way to define a point in the script without loading a text file? Or even if some initial points are loaded, is there a way to define subsequent points based on them? For example:
Code:
var PF1 = agb.FPoint(agc.FPointConstruction, agc.FPointCoordinateFile); //Creates basic feature PF1.Name = "TablePoints"; //This is not required PF1.CoordinateFile = "D:\\Samples\\Table.txt"; agb.Regen(); //Feature not complete until this is done // The above is from the manual NewPoint = PF1.GetPoint(1,1) + (0,0,1); // i.e. translated 1 unit in the Z-direction |
|
June 25, 2015, 19:04 |
|
#2 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi NC,
You can define your Point coordinate directly in the script just like you do in your coordinate file Code:
p.c11= Point(0.446215,0.073264); Hope it helps Cheers KAPI |
|
June 25, 2015, 19:23 |
|
#3 |
Member
NC
Join Date: Jan 2015
Posts: 49
Rep Power: 11 |
Thanks, Kapi, but that doesn't work for me. Depending on the variable I use (left of the equality sign), I either get "'p' is not defined" or "object is expected." Any thoughts?
Can the Point() function really be used as is without any object prefix (like "agb")? And why is the coordinate (x,y) instead of (x,y,z)? If I can define a point in the script, then translation should be straightforward the GetPointZ() method and the like. |
|
June 25, 2015, 19:35 |
|
#4 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi NC,
This is How "P" is defined. Code:
function planeSketchesOnly6 (p) { p.Plane = agb.GetActivePlane(); p.Origin = p.Plane.GetOrigin(); p.XAxis = p.Plane.GetXAxis(); p.YAxis = p.Plane.GetYAxis(); p.Sk6 = p.Plane.NewSketch(); p.Sk6.Name ="Sketch6"; with (p.Sk6) { p.c11= Point(0.446215,0.073264,0.506585); .... ... } with (p.Plane) { } p.Plane.EvalDimCons(); return p; } var ps1 = planeSketchesOnly6 (new Object()); agb.Regen(); Code:
p.Ln28= Line(0.96724,0.5359512,0.96724,1.075531); Also can I suggest you to go thru Scripting Guide, you will find lot of your answers there and in Help Section. Hope it helps Cheers KAPI |
|
June 25, 2015, 19:45 |
|
#5 |
Member
NC
Join Date: Jan 2015
Posts: 49
Rep Power: 11 |
Many thanks. That gives me something to work with.
By "Scripting Guide," do you mean the section under Workbench help? I scanned that quickly but it doesn't seem to pertain to DM specifically. So instead, I've been reading "Scripting API" in DM's manual, which is more specific but doesn't answer all of my questions. |
|
June 25, 2015, 20:02 |
|
#6 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi NC,
"Scripting Guide" will help you understand the flow of how scripts are used. "Scripting API" or DM user's guide will help you create Geometry specifically. So you need to go thru both to understand the overall process. Good Luck Cheers KAPI |
|
Tags |
scripting |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Robin B.C. | Yu | FLUENT | 3 | May 27, 2012 04:19 |
Define Point arrays on a curve | selim | FLUENT | 0 | June 4, 2008 10:30 |
REAL GAS UDF | brian | FLUENT | 6 | September 11, 2006 08:23 |
Free surface boudary conditions with SOLA-VOF | Fan | Main CFD Forum | 10 | September 9, 2006 12:24 |
UDF FOR UNSTEADY TIME STEP | mayur | FLUENT | 3 | August 9, 2006 10:19 |