Geo Redes

Modelos de Redes - Modelos Territoriales - Modelos Matemáticos - Restituciones Fotogramétricas - Levantamientos Geodésicos

lunes, junio 25, 2007

Intervención de un objeto externo, desde una rutina en Avenue Script


fila = self.get(0)
columna = self.get(1)
valor = self.get(2)

' Create the ArcView DDEClient. This initiates the Excel conversation.
' Verify that there are no errors.

systemClient = DDEClient.Make("Excel", "System")
if (systemClient.HasError) then
MsgBox.error(systemClient.GetErrorMsg, "")
exit
end

' Create the new Excel worksheet
'systemClient.Execute("[NEW(1,0,FALSE)]")
' Get the name of the new worksheet. Selection is an Excel item
' supported for the System topic.

selection = systemClient.Request("Selection")
spreadsheet = selection.Left(selection.IndexOf("!"))

' Ensure R1C1 format
systemClient.Execute("[Workspace(,,TRUE)]")
systemClient.Close

' Open a new conversation with the Excel spreadsheet as the topic
ssClient = ddeClient.Make("Excel", spreadsheet)
' Get table information for later use
'tableName = theTable.GetName
'theVTab = theTable.GetVTab
'theFields = theVTab.GetFields
' Write the table name to the spreadsheet
row = fila
column = columna
'ssClient.Poke("F"+row.AsString+"C"+column.AsString, tableName)
' Allow user to select fields of interest

' Write chosen field names to the spreadsheet
'row = 2
'column = 0

' Write the values for selected features to spreadsheet
datastring = valor.asstring
ssClient.Poke("F"+row.AsString+"C"+column.AsString, dataString)

ssClient.Close