Jump to content

Calculate Meters from Latitude and Longitude step


gtwirth

Recommended Posts

Here is an example of a custom step that will calculate the number of meters (x and z) between two points based on latitudes and longitudes.


2014-04-08...This post was updated to read the model origin coordinates and object coordinates from a table ( ObjectLocations ). Also, there is a design time add-in in this doe called "UpdatedLatLongAddIn" that will calculate the X and Z object locations based on the model origin coordinates and object coordinates and move the object to the location in the facility view.


To setup the step, follow these instructions:


1) Download the "CalcMetersFromLatLongs_DLL.zip"


2) Extract "CalcMetersFromLatLongs.dll" from the "CalcMetersFromLatLongs_DLL.zip" into a temp folder (e.g. c:\temp).


3) Right-click the assembly and select properties. Then choose to "unblock" button and press apply. (only needed for Windows 7 and later).


4) Copy "CalcMetersFromLatLongs.dll" into "C:\Users\\Documents\SimioUserExtensions". You might need to add the SimioUserExtensions folder under MyDocuments (C:\Users\\Documents) if it does not already exist.


CalcMetersFromLatLongsModel.spfx uses the Calc Meters From Lat Long step to calculate the number of meters (x and z) between Pittsburgh and Philadelphia. Once the distance is calculated, it moves the entity from the origin (location of Pittsburgh) to the location of Philadelphia.

 

CalcMetersFromLatLongsModel.thumb.png.9a03000f4e2564f423af2e38a4daae2e.png

 

The code (CalcMetersFromLatLongs_Code.zip) is not needed to run the example. It is just provided in case anyone want to see now the step was defined.

CalcMetersFromLatLongs_Code.zip

CalcMetersFromLatLongsModel.spfx

CalcMetersFromLatLongs_DLL.zip

Link to comment
Share on other sites

×
×
  • Create New...