<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using Corpscon6.dll with python to convert State Plane to Lat/Long in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-corpscon6-dll-with-python-to-convert-state/m-p/18789#M1456</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the info jscheirer. I read the ctypes documentation and changed my code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure I understand the ctypes correctly, but I am not getting errors and (now that I changed the SetOutSystem to 1) I am getting the right return values!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# -*- coding: cp1252 -*-
#define objects from corpscon.dll
from ctypes import* 
corpslib = windll.LoadLibrary("c:\program files\corpscon6\corpscon_v6.dll")
#
test00=corpslib.corpscon_default_config()
# define objects
SetNadconPath=corpslib.SetNadconPath&amp;nbsp;&amp;nbsp; #1
SetVertconPath=corpslib.SetVertconPath #2
SetGeoidPath=corpslib.SetGeoidPath&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #3
SetInSystem=&amp;nbsp; corpslib.SetInSystem&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #10
SetInDatum=&amp;nbsp; corpslib.SetInDatum&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #11
SetOutSystem= corpslib.SetOutSystem&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #12
SetInZone&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp; corpslib.SetInZone&amp;nbsp;&amp;nbsp;&amp;nbsp; #27
SetOutZone&amp;nbsp; =&amp;nbsp; corpslib.SetOutZone&amp;nbsp; #14
SetInUnits&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp; corpslib.SetInUnits&amp;nbsp;&amp;nbsp;&amp;nbsp; #28
SetOutUnits&amp;nbsp; =&amp;nbsp; corpslib.SetOutUnits&amp;nbsp; #15
SetInVDatum&amp;nbsp;&amp;nbsp; = corpslib.SetInVDatum&amp;nbsp;&amp;nbsp; #22
SetOutVDatum&amp;nbsp; =&amp;nbsp; corpslib.SetOutVDatum&amp;nbsp; #23
SetInVUnits =&amp;nbsp; corpslib.SetInVUnits #24
SetOutVUnits&amp;nbsp; =&amp;nbsp; corpslib.SetOutVUnits&amp;nbsp; #25
SetGeoidCodeBase&amp;nbsp; =&amp;nbsp; corpslib.SetGeoidCodeBase&amp;nbsp; #26
SetXIn=corpslib.SetXIn
SetYIn=corpslib.SetYIn
SetZIn=corpslib.SetZIn
GetXOut= corpslib.GetXOut
GetYOut= corpslib.GetYOut
GetZOut= corpslib.GetZOut
#
# set ctypes data type
import ctypes
SetNadconPath.argtypes = [ctypes.c_char_p]
SetNadconPath.retval =[ctypes.c_int]
SetVertconPath.argtypes = [ctypes.c_char_p]
SetVertconPath.retval = [ctypes.c_int]
SetGeoidPath.argtypes = [ctypes.c_char_p]
SetGeoidPath.retval =[ctypes.c_int]
SetInSystem.argtypes = [ctypes.c_int]
SetInSystem.retval = [ctypes.c_int]
SetInDatum.argtypes = [ctypes.c_int]
SetInDatum.retval =[ctypes.c_int]
SetOutSystem.argtypes = [ctypes.c_int]
SetOutSystem.retval = [ctypes.c_int]
SetInZone.argtypes = [ctypes.c_int]&amp;nbsp;&amp;nbsp;&amp;nbsp; 
SetInZone .retval = [ctypes.c_int]
SetOutZone.argtypes = [ctypes.c_int]&amp;nbsp; 
SetOutZone .retval = [ctypes.c_int] 
SetInUnits.argtypes = [ctypes.c_int]
SetInUnits .retval =[ctypes.c_int] 
SetInVDatum.argtypes = [ctypes.c_int]&amp;nbsp;&amp;nbsp; 
SetInVDatum .retval = [ctypes.c_int]&amp;nbsp;&amp;nbsp; 
SetOutVDatum.argtypes = [ctypes.c_int]&amp;nbsp; 
SetOutVDatum .retval =[ctypes.c_int]&amp;nbsp; 
SetInVUnits.argtypes = [ctypes.c_int] 
SetInVUnits .retval =[ ctypes.c_int] 
SetOutVUnits.argtypes = [ctypes.c_int]&amp;nbsp; 
SetOutVUnits .retval =[ ctypes.c_int]
SetGeoidCodeBase.argtypes = [ctypes.c_int]&amp;nbsp; 
SetGeoidCodeBase&amp;nbsp; .retval =[ ctypes.c_int]
SetXIn.argtypes = [ctypes.c_double]
SetXIn.retval =[ ctypes.c_int]
SetYIn.argtypes = [ctypes.c_double]
SetYIn.retval = [ctypes.c_int]
SetZIn.argtypes = [ctypes.c_double]
SetZIn.retval =[ ctypes.c_int]
GetXOut.retval =[ ctypes.c_double]
GetYOut.retval =[ ctypes.c_double]
GetZOut.retval = [ctypes.c_double]
#
# set up dll data
test1=SetNadconPath("C:\Program Files\Corpscon6\Nadcon")
test2=SetVertconPath("C:\Program Files\Corpscon6\Vertcon")
test3=SetGeoidPath("C:\Program Files\Corpscon6\Geoid")
x10=2
test10 =&amp;nbsp; SetInSystem(x10)
x11=1927
test11 =&amp;nbsp; SetInDatum(x11)
x12=1
test12= SetOutSystem(x12)
x14=x27=1602
test27 =&amp;nbsp; SetInZone(x27)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #NAD83 or NAD27 zone (1602 is Ky South)
test14 =&amp;nbsp; SetOutZone(x14)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #' NAD83 or NAD27 zone (1602 is Ky South)
x15=x28=1
test28 =&amp;nbsp; SetInUnits(x28)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1=USFT, 2=IFT, 3=Meter
test15 =&amp;nbsp; SetOutUnits(x15)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1=USFT, 2=IFT, 3=Meter
x22=x23=1929
test22 = SetInVDatum(x22)&amp;nbsp;&amp;nbsp; # Vdatum 1929, 1988, 1980
test23 =&amp;nbsp; SetOutVDatum(x23)&amp;nbsp; # Vdatum 1929, 1988, 1980
x24=x25=1
test24 =&amp;nbsp; SetInVUnits(x24)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; 1=USFT, 2=IFT, 3=Meter
test25 =&amp;nbsp; SetOutVUnits(x25)&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1=USFT, 2=IFT, 3=Meter
x26=2003
test26 =&amp;nbsp; SetGeoidCodeBase(x26)
test16=corpslib.corpscon_initialize_convert()
#
#Enter points and convert
StartX=2790955
StartY=503380
inx = c_double(StartX)
iny = c_double(StartY)
inz = c_double(0.00)
outx = c_double()
outy = c_double()
outz = c_double()
SetXIn(inx)
SetYIn(iny)
SetZIn(inz)
corpslib.corpscon_convert()
corpslib.GetXOut.restype = c_double
corpslib.GetYOut.restype = c_double
corpslib.GetZOut.restype = c_double
PtX = corpslib.GetXOut()
PtY = corpslib.GetYOut()
print PtX, PtY
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 20:45:39 GMT</pubDate>
    <dc:creator>BillyBarrows</dc:creator>
    <dc:date>2021-12-10T20:45:39Z</dc:date>
    <item>
      <title>Using Corpscon6.dll with python to convert State Plane to Lat/Long</title>
      <link>https://community.esri.com/t5/python-questions/using-corpscon6-dll-with-python-to-convert-state/m-p/18787#M1454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi. first post here. (running Windows 7)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am a beginner in python, but I have a working version of this function in visual basic that I want to use in python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I use the corpscon6.dll library to convert coordinates from state plane to Latitude/Longitude. My next step will be to write a shapefile using the shapefile.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The corpscon.dll, Nadcon,Vertcon and Geoid data are a free download from &lt;/SPAN&gt;&lt;A href="http://www.agc.army.mil/Missions/Corpscon.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.agc.army.mil/Missions/Corpscon.aspx&lt;/A&gt;&lt;SPAN&gt;. I put these downloaded files in "C:\Program Files\Corpscon6" as suggested.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following setup code seems to work (all the test variables return 1, a negative value means error)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: you can paste it into your IDLE and run as one line...&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;exec('''
from ctypes import* 
corpslib = windll.LoadLibrary("c:\program files\corpscon6\corpscon_v6.dll")
test00=corpslib.corpscon_default_config()
test1=corpslib.SetNadconPath("C:\Program Files\Corpscon6\Nadcon")
test2=corpslib.SetVertconPath("C:\Program Files\Corpscon6\Vertcon")
test3=corpslib.SetGeoidPath("C:\Program Files\Corpscon6\Geoid")
x10=2
test10 =&amp;nbsp; corpslib.SetInSystem(x10)
x11=1927
test11 =&amp;nbsp; corpslib.SetInDatum(x11)
x12=3
test12= corpslib.SetOutSystem(x12)
x14=x27=1602
test27 =&amp;nbsp; corpslib.SetInZone(x27)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #NAD83 or NAD27 zone (1602 is Ky South)
test14 =&amp;nbsp; corpslib.SetOutZone(x14)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #' NAD83 or NAD27 zone (1602 is Ky South)
x15=x28=1
test28 =&amp;nbsp; corpslib.SetInUnits(x28)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1=USFT, 2=IFT, 3=Meter
test15 =&amp;nbsp; corpslib.SetOutUnits(x15)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1=USFT, 2=IFT, 3=Meter
x22=x23=1929
test22 = corpslib.SetInVDatum(x22)&amp;nbsp;&amp;nbsp; # Vdatum 1929, 1988, 1980
test23 =&amp;nbsp; corpslib.SetOutVDatum(x23)&amp;nbsp; # Vdatum 1929, 1988, 1980
x24=x25=1
test24 =&amp;nbsp; corpslib.SetInVUnits(x24)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; 1=USFT, 2=IFT, 3=Meter
test25 =&amp;nbsp; corpslib.SetOutVUnits(x25)&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1=USFT, 2=IFT, 3=Meter
x26=2003
test26 =&amp;nbsp; corpslib.SetGeoidCodeBase(x26)
''')&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next I initilize the conversion &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;test16=corpslib.corpscon_initialize_convert()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then entering the coordinates should go like this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;exec('''
xVal=2790955
yVal=503380
zVal=1000
test17 =&amp;nbsp; corpslib.SetXIn(xVal)
test18 =&amp;nbsp; corpslib.SetYIn(yVal)
test18 =&amp;nbsp; corpslib.SetZIn(zVal)
test19 = corpslib.corpscon_convert()
longOut = corpslib.GetXOut()
latOut = corpslib.GetYOut()
zOut = corpslib.GetZOut()
''')&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;however the line&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;corpslib.SetXin(xVal)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;seems to be a problem... I get this error...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;pyshell#35&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; corpslib.SetXIn(xVal)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ValueError: Procedure probably called with not enough arguments (4 bytes missing)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My VBA application runs this code ok. Does anyone know what I might be missing??&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Billy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:45:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-corpscon6-dll-with-python-to-convert-state/m-p/18787#M1454</guid>
      <dc:creator>BillyBarrows</dc:creator>
      <dc:date>2021-12-10T20:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using Corpscon6.dll with python to convert State Plane to Lat/Long</title>
      <link>https://community.esri.com/t5/python-questions/using-corpscon6-dll-with-python-to-convert-state/m-p/18788#M1455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You haven't cast your x/y values into floats like the &lt;/SPAN&gt;&lt;A href="http://tec.army.mil/corpscon/using_the_corpscon_dll.pdf" rel="nofollow noopener noreferrer" target="_blank"&gt;DLL documentation&lt;/A&gt;&lt;SPAN&gt; asks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I very, very, very strongly recommend you read the ctypes documentation's &lt;/SPAN&gt;&lt;A href="http://docs.python.org/2.7/library/ctypes.html#specifying-the-required-argument-types-function-prototypes" rel="nofollow noopener noreferrer" target="_blank"&gt;section on specifying the input/return types in an imported function&lt;/A&gt;&lt;SPAN&gt;. This way the arguments will be sanity-checked before calling the functions in the DLL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SetXIn = corpslib.SetXIn
SetXIn.argtypes = [ctypes.c_double]
SetXIn.retval = ctypes.c_int

SetXIn(2790955)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:45:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-corpscon6-dll-with-python-to-convert-state/m-p/18788#M1455</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2021-12-10T20:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using Corpscon6.dll with python to convert State Plane to Lat/Long</title>
      <link>https://community.esri.com/t5/python-questions/using-corpscon6-dll-with-python-to-convert-state/m-p/18789#M1456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the info jscheirer. I read the ctypes documentation and changed my code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure I understand the ctypes correctly, but I am not getting errors and (now that I changed the SetOutSystem to 1) I am getting the right return values!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# -*- coding: cp1252 -*-
#define objects from corpscon.dll
from ctypes import* 
corpslib = windll.LoadLibrary("c:\program files\corpscon6\corpscon_v6.dll")
#
test00=corpslib.corpscon_default_config()
# define objects
SetNadconPath=corpslib.SetNadconPath&amp;nbsp;&amp;nbsp; #1
SetVertconPath=corpslib.SetVertconPath #2
SetGeoidPath=corpslib.SetGeoidPath&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #3
SetInSystem=&amp;nbsp; corpslib.SetInSystem&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #10
SetInDatum=&amp;nbsp; corpslib.SetInDatum&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #11
SetOutSystem= corpslib.SetOutSystem&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #12
SetInZone&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp; corpslib.SetInZone&amp;nbsp;&amp;nbsp;&amp;nbsp; #27
SetOutZone&amp;nbsp; =&amp;nbsp; corpslib.SetOutZone&amp;nbsp; #14
SetInUnits&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp; corpslib.SetInUnits&amp;nbsp;&amp;nbsp;&amp;nbsp; #28
SetOutUnits&amp;nbsp; =&amp;nbsp; corpslib.SetOutUnits&amp;nbsp; #15
SetInVDatum&amp;nbsp;&amp;nbsp; = corpslib.SetInVDatum&amp;nbsp;&amp;nbsp; #22
SetOutVDatum&amp;nbsp; =&amp;nbsp; corpslib.SetOutVDatum&amp;nbsp; #23
SetInVUnits =&amp;nbsp; corpslib.SetInVUnits #24
SetOutVUnits&amp;nbsp; =&amp;nbsp; corpslib.SetOutVUnits&amp;nbsp; #25
SetGeoidCodeBase&amp;nbsp; =&amp;nbsp; corpslib.SetGeoidCodeBase&amp;nbsp; #26
SetXIn=corpslib.SetXIn
SetYIn=corpslib.SetYIn
SetZIn=corpslib.SetZIn
GetXOut= corpslib.GetXOut
GetYOut= corpslib.GetYOut
GetZOut= corpslib.GetZOut
#
# set ctypes data type
import ctypes
SetNadconPath.argtypes = [ctypes.c_char_p]
SetNadconPath.retval =[ctypes.c_int]
SetVertconPath.argtypes = [ctypes.c_char_p]
SetVertconPath.retval = [ctypes.c_int]
SetGeoidPath.argtypes = [ctypes.c_char_p]
SetGeoidPath.retval =[ctypes.c_int]
SetInSystem.argtypes = [ctypes.c_int]
SetInSystem.retval = [ctypes.c_int]
SetInDatum.argtypes = [ctypes.c_int]
SetInDatum.retval =[ctypes.c_int]
SetOutSystem.argtypes = [ctypes.c_int]
SetOutSystem.retval = [ctypes.c_int]
SetInZone.argtypes = [ctypes.c_int]&amp;nbsp;&amp;nbsp;&amp;nbsp; 
SetInZone .retval = [ctypes.c_int]
SetOutZone.argtypes = [ctypes.c_int]&amp;nbsp; 
SetOutZone .retval = [ctypes.c_int] 
SetInUnits.argtypes = [ctypes.c_int]
SetInUnits .retval =[ctypes.c_int] 
SetInVDatum.argtypes = [ctypes.c_int]&amp;nbsp;&amp;nbsp; 
SetInVDatum .retval = [ctypes.c_int]&amp;nbsp;&amp;nbsp; 
SetOutVDatum.argtypes = [ctypes.c_int]&amp;nbsp; 
SetOutVDatum .retval =[ctypes.c_int]&amp;nbsp; 
SetInVUnits.argtypes = [ctypes.c_int] 
SetInVUnits .retval =[ ctypes.c_int] 
SetOutVUnits.argtypes = [ctypes.c_int]&amp;nbsp; 
SetOutVUnits .retval =[ ctypes.c_int]
SetGeoidCodeBase.argtypes = [ctypes.c_int]&amp;nbsp; 
SetGeoidCodeBase&amp;nbsp; .retval =[ ctypes.c_int]
SetXIn.argtypes = [ctypes.c_double]
SetXIn.retval =[ ctypes.c_int]
SetYIn.argtypes = [ctypes.c_double]
SetYIn.retval = [ctypes.c_int]
SetZIn.argtypes = [ctypes.c_double]
SetZIn.retval =[ ctypes.c_int]
GetXOut.retval =[ ctypes.c_double]
GetYOut.retval =[ ctypes.c_double]
GetZOut.retval = [ctypes.c_double]
#
# set up dll data
test1=SetNadconPath("C:\Program Files\Corpscon6\Nadcon")
test2=SetVertconPath("C:\Program Files\Corpscon6\Vertcon")
test3=SetGeoidPath("C:\Program Files\Corpscon6\Geoid")
x10=2
test10 =&amp;nbsp; SetInSystem(x10)
x11=1927
test11 =&amp;nbsp; SetInDatum(x11)
x12=1
test12= SetOutSystem(x12)
x14=x27=1602
test27 =&amp;nbsp; SetInZone(x27)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #NAD83 or NAD27 zone (1602 is Ky South)
test14 =&amp;nbsp; SetOutZone(x14)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #' NAD83 or NAD27 zone (1602 is Ky South)
x15=x28=1
test28 =&amp;nbsp; SetInUnits(x28)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1=USFT, 2=IFT, 3=Meter
test15 =&amp;nbsp; SetOutUnits(x15)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1=USFT, 2=IFT, 3=Meter
x22=x23=1929
test22 = SetInVDatum(x22)&amp;nbsp;&amp;nbsp; # Vdatum 1929, 1988, 1980
test23 =&amp;nbsp; SetOutVDatum(x23)&amp;nbsp; # Vdatum 1929, 1988, 1980
x24=x25=1
test24 =&amp;nbsp; SetInVUnits(x24)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; 1=USFT, 2=IFT, 3=Meter
test25 =&amp;nbsp; SetOutVUnits(x25)&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1=USFT, 2=IFT, 3=Meter
x26=2003
test26 =&amp;nbsp; SetGeoidCodeBase(x26)
test16=corpslib.corpscon_initialize_convert()
#
#Enter points and convert
StartX=2790955
StartY=503380
inx = c_double(StartX)
iny = c_double(StartY)
inz = c_double(0.00)
outx = c_double()
outy = c_double()
outz = c_double()
SetXIn(inx)
SetYIn(iny)
SetZIn(inz)
corpslib.corpscon_convert()
corpslib.GetXOut.restype = c_double
corpslib.GetYOut.restype = c_double
corpslib.GetZOut.restype = c_double
PtX = corpslib.GetXOut()
PtY = corpslib.GetYOut()
print PtX, PtY
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:45:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-corpscon6-dll-with-python-to-convert-state/m-p/18789#M1456</guid>
      <dc:creator>BillyBarrows</dc:creator>
      <dc:date>2021-12-10T20:45:39Z</dc:date>
    </item>
  </channel>
</rss>

