Jump to content

Map Editor automation?


Recommended Posts

Hi,

Map Editor does not provide any automation features. You could however achieve map clipping through WAsP scripting. The IVectorMap interface provides a CutWindow method which will do the trick.

Here is some sample code that will clip the selected map (I used Waspdale) in WAsP.


Set Rvea0086Factory = CreateObject("Rvea0086.ObjectFactory")

Set Map = ReportingAssistant.TypeCaster_
.CastMemberToVectorMap(ReportingAssistant.SelectedHierarchyMember)
Set Rect = Rvea0086Factory.CreateRectangle(25000, 35000, 30000, 40000)
Set ClippedMap = Map.CutWindow(Rect)


You could of course then export the map to file and even add it back into the workspace:


' export map to file
MapFilename = "C:\WaspdaleClipped.map"
Set Exportable = ReportingAssistant.TypeCaster.CastObjectToRveaPreservableObject(ClippedMap)
Exportable.PreserveToFile MapFilename

' add map to workspace
Set InsertedMap = CurrentWorkspace.AsIHierarchyMember_
.Insertions.FromFile.ByClassID(ehmcVectorMap).Execute(MapFilename, Nothing)
Link to comment
  • 2 weeks later...
Is there a way to transform the projection of .maps in an automated/scripted way?

Fairly often, I have to convert a large number of .map files back and forth between metric and lat-lon, in order to interface with other applications e.g. Google Earth. Being able to script this would be a huge relief.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...