Hi everybody:

I am a new TransCAD's user and I have heard thar TransCAD and Maptitude use similar GISDK languages, even the same. Well, I have problems with route systems... The first cuestion is: Why can't I batch route system? but, only when I want to get Multiple Shortest Path as a matrix File, not as a route system; and the second cuestion is: How Could I select, or identify, all the route paths that cross a link using a macro?

I found this GISDK language on help:

// Before running the example, create a map by opening tutorial\net_part.map.
shared ActiveNetwork

// Get some information about the current network
NetInfo = GetNetworkInformation(ActiveNetwork)

// Obtain the list of network fields
NetLinkFlds = NetInfo.[Link Attributes]

// Build a list of fields required in the route system
//      the route system should have the same fields as the network
xflds = {{"Track",     "Integer", 12, 0, "False"}, {"Impedance", "Real",    12, 2, "False"}}

for i = 1 to NetLinkFlds.length do
   xflds = xflds + {{NetLinkFlds[i], "Real", 12, 2, "False"}}
   end

xflds = xflds + {{"Transfers", "Integer", 10, 0, "False"}}

// Obtain the line layer ID field. The route system will be based on this field.
IDField = GetField(GetIDField(GetLayer()))

opts = {{"Label", "My SP Routes"},  {"Name",  "My SP Routes"},  {"Links Table", "Complete", null, null},
   {"Routes Table", "False", xflds}, {"Stops", "Stops", null}, {"Units", GetMapUnits()}, {"Binary", "True"},
   {"Link ID Field", IDField[3]}}

db = GetLayerDB("Streets")
dbinfo = GetDBLayers(db)

// Create an empty route system with all the required fields
RouteSystem = CreateRouteSystem("tutorial\\test.rts", db, dbinfo[2], opts)
drct = RouteSystem[2]
RouteSystem = RouteSystem[1]

// Add the route system to the current map
lyrs = AddRouteSystemLayer(, RouteSystem, drct,)

// Set the current layer to be the route system layer

SetLayer(RouteSystem)

// Set the route system color
SetLineColor(, NULL)

// Set the route width
SetLineWidth(, 2.5)

// Calculate the shortest path and add them to the route system
AddShortestPathRoutes(ActiveNetwork, RouteSystem, "Street Node|Ambulance",
   "Street Node|Ambulance", null, 1,
   {{"Node ID", "[Street Node].ID"}})

   // Open the map layer dialog box to see information of the route system.

This helps me to create a route system, once I have created the route system, how could I select all the route system paths that contain each link? manually I can do it, but I want to do it using a macro.
I hope my explanation is clear for you...

Thanks for your help

Regards,

Alejandro


Do You Yahoo!? La mejor conexión a Internet y 2GB extra a tu correo por $100 al mes. http://net.yahoo.com.mx

YAHOO! GROUPS LINKS




Reply via email to