Calculate Meters from Latitude and Longitude step

Do you have objects, models, libraries, path decorators, textures, symbols, custom API code, documentation, or anything else others might find useful? Please attach it here with a brief description.
Post Reply
gtwirth
Simio Team Member
Posts: 156
Joined: Mon Jun 09, 2008 4:42 pm

Calculate Meters from Latitude and Longitude step

Post by gtwirth » Wed Feb 12, 2014 2:23 pm

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\<YOUR USERNAME>\Documents\SimioUserExtensions". You might need to add the SimioUserExtensions folder under MyDocuments (C:\Users\<YOUR USERNAME>\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.png
CalcMetersFromLatLongsModel.png (945.08 KiB) Viewed 6464 times
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.
Attachments
CalcMetersFromLatLongs_DLL.zip
(3.68 KiB) Downloaded 482 times
CalcMetersFromLatLongsModel.spfx
(1.5 MiB) Downloaded 460 times
CalcMetersFromLatLongs_Code.zip
(22.71 KiB) Downloaded 485 times
Glen Wirth
Simio LLC

Post Reply