I want to create a program an ArcMap add-in commond

2523
12
11-20-2016 02:04 PM
Abdul_HameedKhorami1
New Contributor III

I want to create and program an arc map add in commend in vb.net. to calculates a measure of gender structure ((Male_pop/FEAMLE_POP)*100 in a GenderStr field. I am getting an error I have included both my code and error message I am getting. I am wondering if anyone can help me what is the problem to solve this error?

thanks

0 Kudos
12 Replies
curtvprice
MVP Esteemed Contributor

Is [FEMALE_POP] ever zero? If so you would get a runtime error dividing by zero.

0 Kudos
Abdul_HameedKhorami1
New Contributor III

0 Kudos
Abdul_HameedKhorami1
New Contributor III

No .[FEMALE_POP] is not zero !

0 Kudos
curtvprice
MVP Esteemed Contributor

Just thought I'd ask. I have shared your query to a more appropriate forum, maybe an ArcObjects programmer can help you out...

ModyBuchbinder
Esri Regular Contributor

Can you copy & paste the expression from your code into ArcMap? Does it works?

I do not think you need the square brackets any more. 

curtvprice
MVP Esteemed Contributor

Mody, that's a good suggestion.

Square brackets [FIELD] are still used for VBScript expressions, for all data types.

Exclamation points: !FIELD! are used for Python expressions.

Note, you may want to explicitly set the parser (this defaults to VBScript, which will fail if the tool is run in 64 bit).

http://desktop.arcgis.com/en/arcmap/10.4/tools/data-management-toolbox/calculate-field.htm

Abdul_HameedKhorami1
New Contributor III

In arcGIS it works, maybe I am using wrong expression in my programming ? can you help me to write correct expression ?

0 Kudos
Abdul_HameedKhorami1
New Contributor III

0 Kudos
ModyBuchbinder
Esri Regular Contributor

I hope GenderStr is double and not string. ArcMap will translate automatically but not the code