Your error sounds like your using a non declared function. Below is a
sample on using the Intervisibility vm sdk function:
Sub vmInterVisibilitySub(ByVal oCrossSectionLine as object)
Dim sResultsMIF As String, sLineMIF, sZUnitDescription As String
Dim dFromX, dFromY, dFromZAdjust, dToX, dToY As Float
Dim dToZAdjust, dEarthCurvature, dObstructionHeight,dToAdjustment,
dFromAdjustment As Float
Dim iReceiverVisible, iNumSamples As integer
Dim tPointToPointData(0) As CROSS_SECTION_POINT
Dim lErrCode as integer
Dim str, sErrMsg as string
Dim i As Integer
Dim nGridValue, plReturnType As Integer, pdGRDValue As Float,
ppszGRCValue As Integer
ReDim tPointToPointData(iSamples) 'iSamples from dialog input
Set Coordsys Table SELECTION
dFromX = ObjectGeoGraphy(oCrossSectionLine,OBJ_GEO_LINEBEGX)
dFromY = ObjectGeography(oCrossSectionLine,OBJ_GEO_LINEBEGY)
dToX = ObjectGeography(oCrossSectionLine,OBJ_GEO_LINEENDX)
dToY = ObjectGeography(oCrossSectionLine,OBJ_GEO_LINEENDY)
Ant.fPositionX1 = dFromX
Ant.fPositionY1 = dFromY
Ant.fPositionX2 = dToX
Ant.fPositionY2 = dToY
Ant.fAzimuth1 =
GetNorthDegAngle(Ant.fPositionX1,Ant.fPositionY1,Ant.fPositionX2,Ant.fPo
sitionY2)
Ant.fAzimuth1 = Round(Ant.fAzimuth1,1)
Ant.fAzimuth2 =
GetNorthDegAngle(Ant.fPositionX2,Ant.fPositionY2,Ant.fPositionX1,Ant.fPo
sitionY1)
Ant.fAzimuth2 = Round(Ant.fAzimuth2,1)
sResultsMIF = "Data\elevationInterVisResults.mif"
sLineMIF = "Data\elevationInterVisLine.mif"
dFromZAdjust = 0
dToZAdjust = 0
sZUnitDescription = "Fresnel calculator"
dEarthCurvature = 4/3
iNumSamples = iSamples 'from dialog
If fgGridID = 0 Then
Call SetupVMSDK
End If
lErrCode = vmInterVisibility(fgGridID, sResultsMIF, sLineMIF, dFromX,
dFromY, dFromZAdjust,
dToX, dToY, dToZAdjust, dEarthCurvature, sZUnitDescription,
iReceiverVisible, dObstructionHeight, dToAdjustment,
dFromAdjustment,
iNumSamples, tPointToPointData())
'If iReceiverVisible = 0 Then
' Print "The receiver is visible"
'Else
' Print "The receiver is not visible"
'End If
'Print "The height of obstruction is " + Str$(dObstructionHeight)
'Print "Adjust to point by " + Str$(dToAdjustment) + " to make points
intervisible."
'Print "Adjust from point by " + Str$(dFromAdjustment) + " to make
points intervisible."
If TableOpen("FRESNEL_DATA") Then
Drop Table "FRESNEL_DATA"
End If
'* Create temp table from array tPointToPointData to use with fresnel
graph
Create Table "FRESNEL_DATA"
(Distance Float,E Float,Fresnel_Z Float,Fresnel1 Float,Fresnel2
Float)
File ApplicationDirectory$() + "Data\FRESNEL_DATA"'
TempFileName$("")
Set Table "FRESNEL_DATA" FastEdit On Undo Off
For i = 1 To iNumSamples
Insert Into FRESNEL_DATA (Distance,E)
Values
(
Round(tPointToPointData(i).Dist,1),
tPointToPointData(i).Elevation
)
Next
If fgGridID = 0 Then
Call SetupVMSDK
End If
'*vmInterVisibility forgets the very last node - this is a fix for
thix
nGridValue =
vmGetGridValue(dToX,dToY,fgGridID,plReturnType,pdGRDValue,ppszGRCValue)
Insert Into FRESNEL_DATA (Distance,E)
Values
(
ObjectLen(oCrossSectionLine,"m"),
Round(pdGRDValue,1)
)
'* Get ground height
Ant.fSurfaceLevel2 = Round(pdGRDValue,0.1)
nGridValue =
vmGetGridValue(dFromX,dFromY,fgGridID,plReturnType,pdGRDValue,ppszGRCVal
ue)
Ant.fSurfaceLevel1 = Round(pdGRDValue,0.1)
If lErrCode <> 0 Then
GoTo ERR_VMCALL
End If
Call CreateFresnel("FRESNEL_DATA")
'''''''''''''''''''''''''''''''''''''''''''''
Exit Sub
ERR_VMCALL:
Call vmGetErrorText(lErrCode, sErrMsg)
Note "Call to vmInterVisibility failed. " + sErrMsg
'lErrCode = vmCloseGrid(fgGridID)
Exit Sub
End Sub
Also remember to have a correct grid id to refer in your functions:
fgGridID = GetVMGridID(sPathVMGrid)
'''''''''''''''''''''''''''''''''''''''''''''''''''''
' GetVMGridID
'''''''''''''''''''''''''''''''''''''''''''''''''''''
Function GetVMGridID(ByVal sPath as string) as float
'sPath like: ApplicationDirectory$() + "Datakbh\" + smGRDtabnam
+ ".tab"
Dim fGrd as float
'Get the vm grid ID
fGrd = vmOpenGrid(sPath, 0)
If fGrd = 0 Then
Note "Error referencing grid: " + sPath
End If
GetVMGridID = fGrd
End Function
HTH,
Jakob Lanstorp
Software Consultant
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S
Tel +45 6311 4900
Fax +45 6311 4949
Mob +45 5050 8087
E-mail [EMAIL PROTECTED]
http://www.cowi.dk
http://www.cowi.com
-----Original Message-----
From: Janet Sietsma [mailto:[EMAIL PROTECTED]
Sent: Friday, November 04, 2005 12:47 AM
To: [email protected]
Subject: MI - L Vertical Mapper Grid Calculator (vmGridCalculator)
________________________________________________________________________
_______________
Note: This e-mail is subject to the disclaimer contained at the bottom
of this message.
________________________________________________________________________
_______________
Hi everyone
I am trying writing a MapBasic application to operate VMGridCalculator
but it is not working. I keep getting the error message of "Unrecognized
Command: ( " at the line in the program which calls the vm function.
Does anyone have a worked example of how to operate this function?
Many thanks.
Regards,
Janet Sietsma
________________________________________________________________________
_______________
The information transmitted in this message and its attachments (if any)
is intended
only for the person or entity to which it is addressed.
The message may contain confidential and/or privileged material. Any
review,
retransmission, dissemination or other use of, or taking of any action
in reliance
upon this information, by persons or entities other than the intended
recipient is
prohibited.
If you have received this in error, please contact the sender and delete
this e-mail
and associated material from any computer.
The intended recipient of this e-mail may only use, reproduce, disclose
or distribute
the information contained in this e-mail and any attached files, with
the permission
of the sender.
This message has been scanned for viruses with Symantec Scan Engine and
cleared by
MailMarshal.
________________________________________________________________________
_______________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 18570