CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > ANSYS Meshing & Geometry

[DesignModeler] Define a new point in a script

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 25, 2015, 18:43
Default Define a new point in a script
  #1
Member
 
NC
Join Date: Jan 2015
Posts: 49
Rep Power: 11
bongbang is on a distinguished road
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
Thank you.
bongbang is offline   Reply With Quote

Old   June 25, 2015, 19:04
Default
  #2
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14
Kapi is on a distinguished road
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);
I am not sure how to use old geometry points and translate the point.

Hope it helps

Cheers
KAPI
Kapi is offline   Reply With Quote

Old   June 25, 2015, 19:23
Default
  #3
Member
 
NC
Join Date: Jan 2015
Posts: 49
Rep Power: 11
bongbang is on a distinguished road
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.
bongbang is offline   Reply With Quote

Old   June 25, 2015, 19:35
Default
  #4
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14
Kapi is on a distinguished road
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();
You can define point straight forward like above and Lines as well if you need like below

Code:
p.Ln28= Line(0.96724,0.5359512,0.96724,1.075531);
Once you have Point like "c11" you can try and use translation, I have never used it hence cant comment on it.
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
Kapi is offline   Reply With Quote

Old   June 25, 2015, 19:45
Default
  #5
Member
 
NC
Join Date: Jan 2015
Posts: 49
Rep Power: 11
bongbang is on a distinguished road
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.
bongbang is offline   Reply With Quote

Old   June 25, 2015, 20:02
Default
  #6
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14
Kapi is on a distinguished road
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
Kapi is offline   Reply With Quote

Reply

Tags
scripting


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


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