Select to view content in your preferred language

9.3.1 Extract Measure Values From Points To Attribute Table (precision and scale)

1166
1
01-10-2013 09:42 AM
DamienMaggio
New Contributor
ArcInfo 9.3.1

Is there any way to get the measure value of a point feature into an attribute field of a point shapefile with the correct precision and scale?

I'm trying to generate a spreadsheet of Measure Values (and X, Y values) of all the vertices from a line feature. In other words all of the attributes from the Edit Sketch Properties Window. It would be nice if there was an export function from the Edit/Sketch Properties window to a spreadsheet but as far as I know there is not a way to export this table at all. Or at the very least have the ability to use Calculate Geometry to populate Z values and M values into an attribute field (it works very well for X and Y values)

I've completed the following steps to get what I need:
1. Feature Vertices To Points - this generates a point file of all vertices of the line. Each point contains attributes from the line itself. From here I can create 4 new fields (X, Y, Z, and M) in the Attribute Table
2. Use the Calculate Geometry function to populate the X and Y fields
3. Use the advanced Field Calculator and VBScript to populate the Z and M fields with the Z Values and Measure Values using the following script (swapping out pPoint.Z and pPoint.M to get those values respectively).

PRE-LOGIC VBA SCRIPT CODE

Dim Output As Double
Dim pPoint As IPoint
Set pPoint = [Shape]
Output = pPoint.M

M=
Output

This populates the M field with the measure values. However, it rounds up the decimal places into an integer.
For example, Measure Value from point1 = 64.635
The value populated into the M field in the attribute table using the script above has a value of "65" (even though the M field Data Type is Double, Precision = 20 and Scale = 3)

I viewed the .dbf file in excel to see if the Measure Value was actually stored with the correct precision and scale but just not displaying correctly in the Attribute Table.  the Measure Value for point1 = "65.000." This tells me that the VBScript is rounding the value before populating it into the M field.
Can I change the script to grab the actual M value "64.635" and not rounding up to "65?"

Any help would be much appreciated!
Thanks,
Damien
Tags (2)
0 Kudos
1 Reply
DamienMaggio
New Contributor
I've found a solution:
1. use the Feature Vertices To Points (ArcInfo) to generate points from vertices in a line
2. Add XY Coordinates tool. This will add a column for X, Y, Z and M.
0 Kudos