Hexagon Geospatial
MENU

Support GeoMedia

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 32
Registered: ‎12-17-2016
Accepted Solution

Get coordinate of all registers in OrientedPointGeometry object

Geomedia Desktop Professional 6.1
I'm only getting the coordinates of the first record in an OrientedPointGeometry,
but there is more than one record. See a snippet of code below:


For intgNumFields = 0 To objRS.GFields.Count - 1
    If objRS.GFields(intgNumFields).Name = sGeomFldName Then
        If objRS.GFields(intgNumFields).SubType = 10 Then '(point)
            If Not (objRS.EOF And objRS.BOF) Then
                MsgBox objRS.RecordCount & " registers"
 
                Do Until objRS.EOF
                    intgNumLinha = intgNumLinha + 1
                    MsgBox "register " & intgNumLinha
                    MsgBox GeomObj.Origin.X & vbNewLine & GeomObj.Origin.Y
                    objRS.MoveNext
                Loop
            End If
       
            Exit For
        End If
    End If
Next

 

 

Any suggestion?

Thank you all

Technical Evangelist
Posts: 381
Registered: ‎09-11-2015

Re: Get coordinate of all registers in OrientedPointGeometry object

Hi,

 

I am missing some objRS.MoveFirst call, and then assigning the GField.Value to GeomObj variable. I would suggest a sligthly different approach - first try to find the desired geometry field. Then, if it is find, assign it to a GField variable, say objGeomFld = objRS.GFields(iGeomFldIndex), then call objRS.MoveFirst, then iterate through the recordset using Do...While loop and set GeomObj = objGeomFld.Value in each step.

 

Pavel

Contributor
Posts: 32
Registered: ‎12-17-2016

Re: Get coordinate of all registers in OrientedPointGeometry object

Thank you, Pavel.
His approach was exactly what I needed.
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.