FID in shp file in arcmap and autocad maps 3d

650
6
05-24-2017 10:26 AM
OlegIgoshev
New Contributor

When I check FID in shp file in arcmap it starts from "0" but when I connect the data to the same shp file in autocad map 3d it starts from "1". Can anybody explain to me why is that? We have some issue with identification of objects with our client when we using different software. Thank you.

0 Kudos
6 Replies
DanPatterson_Retired
MVP Esteemed Contributor

Yes... shapefiles are 0 based, geodatabase featureclasses are 1 bases.

I bet you have an ID field in the shapefile and I bet it is filled with 0's.  To fix that, use the field calculator expression with a Python Parser,

!FID! +1

to calculate new values for the ID field.  You can then use that field in place of the FID field if you need an index that is 1 based.

OlegIgoshev
New Contributor

Thank you for answer. Do you mean to change actual FID field in shp? Field calculator is not active when I select FID field in table view.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

I was referring to the ID field, you can't change the FID field as you have discovered and you will have noted that an ID field is automatically created by default when creating shapefiles in ArcMap

ChristopherMcClain
Occasional Contributor II

You would probably be best severed by creating a feature ID you create and control if you are switching back and forth between software packages.  Adds a bit of overhead to managing the field but has the ability to save you time and effort in the long run.

VinceAngelo
Esri Esteemed Contributor

The FID column does not actually exist in shapefiles (and if you create one, it will be renamed so as not to conflict).  Therefore the basis for zero-based and one-based counting is entirely arbitrary, which is how ArcGIS chooses 0 and AutoCAD chooses 1.

Best practice would be to avoid using record position for ANY operations.  Instead, create and populate a reliable unique identifier value, then use that.

- V

OlegIgoshev
New Contributor

Thank you.

0 Kudos