Difference between revisions of "ISKernel:navworld (Data Type)"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 14: Line 14:
 
*'''Set['''name''','''x''','''y''']: Sets a point with the given name at (x,y,0)
 
*'''Set['''name''','''x''','''y''']: Sets a point with the given name at (x,y,0)
 
*'''Set['''name''','''x''','''y''','''z''']: Sets a point with the given name at (x,y,z)
 
*'''Set['''name''','''x''','''y''','''z''']: Sets a point with the given name at (x,y,z)
 
+
*'''Export['''filename''']''': Exports a world to <filename>
 
== Returns ==
 
== Returns ==
  

Revision as of 23:48, 19 September 2005

Description

This data types provides information about navigation worlds.

Members

  • int LastID: The highest point ID number in this world
  • navpoint NearestPoint[x]: For use in a single coordinate plane system, retrieves the nearest point to (x,0,0)
  • navpoint NearestPoint[x,y]: Retrieves the nearest point to (x,y,0)
  • navpoint NearestPoint[x,y,z]: Retrieves the nearest point to (x,y,z)
  • navpoint Point[name]: Retrieves the point with the given name
  • navpoint Point[#]: Retrieves the point with this ID number
  • int Points: Total number of points in this world

Methods

  • Set[name,x]: For use in a single coordinate plane system, sets a point with the given name at (x,0,0)
  • Set[name,x,y]: Sets a point with the given name at (x,y,0)
  • Set[name,x,y,z]: Sets a point with the given name at (x,y,z)
  • Export[filename]: Exports a world to <filename>

Returns

Examples

Retrieve total number of points in this world

  • echo ${Navigation.World[earth].Points}
This command returns the total number of points in a world, all paths included

Retrieve the location of a point in a world

  • echo X: ${Navigation.World[earth].Point[Michigan].X} Y: ${Navigation.World[earth].Point[Michigan].Y}
Output
X: -341.77 Y: -2743.61

Find the nearest point to coordinate X

  • echo Nearest Point to -341: ${Navigation.World[earth].NearestPoint[-341]
Output
Nearest Point to -341: Michigan

Find how many points are in the world

  • echo Total Points: ${Navigation.World[earth].LastID}
Output
Total Points: 59

Note: This can be fooled if ID numbers are not set sequentially

Create a point in a world

  • Navigation.World[earth]:Set[Alaska,-5402,-2102]
This command will create a point named "Alaska" at -5402,-2102,0 in the world "earth"

Retrieve navpoint information by #

  • echo Point 13 is ${Navigation.World[earth].Point[13]
output
Point 13 is Cincinatti

See Also