Page 1 of 1

find properties of a reference point to allow changing the rp

Posted: Fri Sep 11, 2020 1:26 pm
by orca
I am trying to find the longitude and latitude of a reference point.

This seems to work.
local rp = ScenEdit_GetReferencePoint({side='Axis', name='test'})
I can then print(rp) and get the properties such as latitude, longitude, etc in the lua consule. But I don't know how to use these printed values into a new script.

So my question is, how do I get the specific value for the latitude of that local rp so that I can then plug this value into a different script. My intention is to use this value in a ScenEdit_SetReferencePoint script to change the location of the latitude and longitude for the local rp using something like this:

local newrplatitude=currentrplatitud + 1
ScenEdit_SetReferencePoint({side='Axis', guid='2QQSQX-0HM2MDDRD4568', latitude=newrplatitud})

RE: find properties of a reference point to allow changing the rp

Posted: Fri Sep 11, 2020 6:59 pm
by KnightHawk75
local rp = ScenEdit_GetReferencePoint({side='Axis', name='test'})
local storedLat = rp.latitude + 1.0;
local storedLon = rp.longitude -1.0;

ScenEdit_SetReferencePoint( {side='Axis', guid='2QQSQX-0HM2MDDRD4568', latitude=storedLat, longitude=storedLon} )

or in a more in-line manner..

local rp = ScenEdit_GetReferencePoint({side='Axis', name='test'})
ScenEdit_SetReferencePoint( {side='Axis', guid='2QQSQX-0HM2MDDRD4568', latitude=(rp.latitude + 1.0), longitude=(rp.longitude - 1.0)} )