OpenVSPAPI  3.20.0
Functions
Measure Tool Functions

This group of API functions can be used to control the Ruler Tool through the API.

Click here to return to the main page. More...

Functions

string AddRuler (const string &in startgeomid, int startsurfindx, double startu, double startw, const string &in endgeomid, int endsurfindx, double endu, double endw, const string &in name)
 
string[] GetAllRulers ()
 
void DelRuler (const string &in id)
 
void DeleteAllRulers ()
 
string AddProbe (const string &in geomid, int surfindx, double u, double w, const string &in name)
 
string[] GetAllProbes ()
 
void DelProbe (const string &in id)
 
void DeleteAllProbes ()
 

Detailed Description

Function Documentation

◆ AddProbe()

string AddProbe ( const string &in  geomid,
int  surfindx,
double  u,
double  w,
const string &in  name 
)

Create a new Probe and add it to the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string probe_id = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" );
SetParmVal( FindParm( probe_id, "Len", "Measure" ), 3.0 );
Parameters
[in]geomidParent Geom ID
[in]surfindxMain surface index from the parent Geom
[in]uSurface u (0 - 1) coordinate
[in]wSurface w (0 - 1) coordinate
[in]nameProbe name
Returns
Probe ID

◆ AddRuler()

string AddRuler ( const string &in  startgeomid,
int  startsurfindx,
double  startu,
double  startw,
const string &in  endgeomid,
int  endsurfindx,
double  endu,
double  endw,
const string &in  name 
)

Create a new Ruler and add it to the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string pid2 = AddGeom( "POD", "" );
SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 );
string rid = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" );
SetParmVal( FindParm( rid, "X_Offset", "Measure" ), 6.0 );
Parameters
[in]startgeomidStart parent Geom ID
[in]startsurfindxMain surface index from the staring parent Geom
[in]startuSurface u (0 - 1) start coordinate
[in]startwSurface w (0 - 1) start coordinate
[in]endgeomidEnd parent Geom ID
[in]endsurfindxMain surface index on the end parent Geom
[in]enduSurface u (0 - 1) end coordinate
[in]endwSurface w (0 - 1) end coordinate
[in]nameRuler name
Returns
Ruler ID

◆ DeleteAllProbes()

void DeleteAllProbes ( )

Delete all Probes from the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string probe_id_1 = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" );
string probe_id_2 = AddProbe( pid1, 0, 0.2, 0.3, "Probe 2" );
array< string > @probe_array = GetAllProbes();
if ( probe_array.size() != 0 ) { Print( "Error: DeleteAllProbes" ); }

◆ DeleteAllRulers()

void DeleteAllRulers ( )

Delete all Rulers from the Meaure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string pid2 = AddGeom( "POD", "" );
SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 );
string rid1 = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" );
string rid2 = AddRuler( pid1, 0, 0.4, 0.6, pid1, 1, 0.8, 0.9, "Ruler 2" );

◆ DelProbe()

void DelProbe ( const string &in  id)

Delete a specific Probe from the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string probe_id_1 = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" );
string probe_id_2 = AddProbe( pid1, 0, 0.2, 0.3, "Probe 2" );
DelProbe( probe_id_1 );
array< string > @probe_array = GetAllProbes();
if ( probe_array.size() != 1 ) { Print( "Error: DelProbe" ); }
Parameters
[in]idProbe ID

◆ DelRuler()

void DelRuler ( const string &in  id)

Delete a particular Ruler from the Meaure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string pid2 = AddGeom( "POD", "" );
SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 );
string rid1 = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" );
string rid2 = AddRuler( pid1, 0, 0.4, 0.6, pid1, 1, 0.8, 0.9, "Ruler 2" );
DelRuler( ruler_array[0] );
Parameters
[in]idRuler ID

◆ GetAllProbes()

string [] GetAllProbes ( )

Get an array of all Probe IDs from the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string probe_id = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" );
array< string > @probe_array = GetAllProbes();
Print( "One Probe: ", false );
Print( probe_array[0] );
Returns
[in] Array of Probe IDs

◆ GetAllRulers()

string [] GetAllRulers ( )

Get an array of all Ruler IDs from the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string pid2 = AddGeom( "POD", "" );
SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 );
string rid1 = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" );
string rid2 = AddRuler( pid1, 0, 0.4, 0.6, pid1, 1, 0.8, 0.9, "Ruler 2" );
array< string > @ruler_array = GetAllRulers();
Print("Two Rulers");
for( int n = 0 ; n < int( ruler_array.length() ) ; n++ )
{
Print( ruler_array[n] );
}
Returns
Array of Ruler IDs
AddRuler
string AddRuler(const string &in startgeomid, int startsurfindx, double startu, double startw, const string &in endgeomid, int endsurfindx, double endu, double endw, const string &in name)
DelProbe
void DelProbe(const string &in id)
GetAllRulers
string[] GetAllRulers()
FindParm
string FindParm(const string &in parm_container_id, const string &in parm_name, const string &in group_name)
DelRuler
void DelRuler(const string &in id)
SetParmVal
double SetParmVal(const string &in parm_id, double val)
GetAllProbes
string[] GetAllProbes()
array
AngelScript ScriptExtension for representing the C++ std::vector.
Definition: openvsp_as.h:244
AddGeom
string AddGeom(const string &in type, const string &in parent=string())
AddProbe
string AddProbe(const string &in geomid, int surfindx, double u, double w, const string &in name)
Print
void Print(const string &in data, bool new_line=true)
DeleteAllRulers
void DeleteAllRulers()
DeleteAllProbes
void DeleteAllProbes()