AutoXChange DLL
Platforms: Windows and Linux Interface: Java Native Interface (JNI)
Background
The AutoXChange DLL (AXDLL) is a JNI_based interface for calling the base AutoXChange functions. It is packaged as an unmanaged Dynamic Link Library (DLL) on Windows and a Shared Object (so) on Linux. It is available as a 64-bit version on each operating system.
The API is documented in a separate volume:
Requirements
Windows
Operating System: Windows 10 or above, Windows Server 2016 or above Compatibility: 64-bit
Linux
Operating System: Linux Kernels using GLIBC++ 2.28 including RHEL/CentOS 8, Debian 10, Ubuntu 20.04 Compatibility: 64-bit
Note: If you need compatibility with pre-GLIBC++ 2.28, please contact us. We can support some of these older Linux Kernels
Operation
AXDLL is called from a Java program. We ship versions for both Java 11 and Java 17, but other versions can be provided upon request. AXDLL can be called separately for each conversion, or as a long running process that converts multiple files.
For a conversion from DWG to DXF:
-
new AxDllConvert()
-
InitDLL
-
Shaker
-
SetOutputFormat(xx) - Optional
SetPreview(boolean) - Optional -
For each DWG/DXF
a. SetInputName(…)
b. SetOutputName(…)
c. OpenInputFile()
d. SaveAsDxf(0) - Not used if SetOutputFormat is used
e. CloseInputFile -
UninitDLL - Optional
Shaker must be called and uses a parameter unique to each user.
SetOutputFormat and SetPreview only need to be called once and can come anywhere after Shaker and before OpenInputFile. As they only have to be called once, it is better to put them outside the loop in a multiple-fiile conversion scenario.
SetOutputFormat and SaveAsDxf are mutually exclusive. If SetOutputFormat is used then OpenInputFile will automatically convert to the specified format and SaveAsDxf is not needed. If SetOutputFormat is not called, then OpenInputFile only opens the Input File and does not do a conversion. A subsequent call to SaveAsDxf then makes the same conversion as SetOutputFormat/OpenInputFile would have.
The parameter on SaveAsDxf is the AutoCAD Version. Currently that is 0 to 33. See table below. A value of 0 will use the same Version as in the input file. That is the recommended operation in most cases.
SetPreview controls whether a Preview is added to the output file. The default is to create the Preview.
Output Formats
| Format | Number |
|---|---|
| DWG | 1 |
| DXF | 2 |
| DWF | 3 |
| 4 | |
| JS | 5 |
| SVG | 6 |
| JPG | 7 |
| GIF | 8 |
| PNG | 9 |
AutoCAD Versions
| Mode | Value | Release |
|---|---|---|
| kDHL_MC0_0 | 0 | Use Current Release |
| kDHL_AC1_2 | 1 | |
| kDHL_AC1_40 | 2 | |
| kDHL_AC1_50 | 3 | |
| kDHL_AC2_20 | 4 | |
| kDHL_AC2_10 | 5 | |
| kDHL_AC2_21 | 6 | |
| kDHL_AC2_22 | 7 | |
| kDHL_1001 | 8 | |
| kDHL_1002 | 9 | Release 2.5 |
| vAC025 | kDHL_1002 | Release 2.5 |
| kDHL_1003 | 10 | Release 2.6 |
| vAC026 | kDHL_1003 | Release 2.6 |
| kDHL_1004 | 11 | Release 9 |
| vAC09 | kDHL_1004 | Release 9 |
| kDHL_1005 | 12 | |
| kDHL_1006 | 13 | Release 10 |
| vAC10 | kDHL_1006 | Release 10 |
| kDHL_1007 | 14 | |
| kDHL_1008 | 15 | |
| kDHL_1009 | 16 | R11 and R12 |
| vAC12 | kDHL_1009 | R11 and R12 |
| kDHL_1010 | 17 | |
| kDHL_1011 | 18 | |
| kDHL_1012 | 19 | R13 |
| vAC13 | kDHL_1012 | R13 |
| kDHL_1013 | 20 | R14 beta |
| vAC14beta | kDHL_1013 | R14 beta |
| kDHL_1014 | 21 | R14 release |
| vAC14 | kDHL_1014 | R14 release |
| kDHL_1500 | 22 | R15 (2000) beta |
| kDHL_1015 | 23 | R15 (2000) release |
| vAC15 | kDHL_1015 | R15 (2000) release |
| kDHL_1800a | 24 | R18 (2004) beta |
| kDHL_1800 | 25 | R18 (2004) release |
| vAC18 | kDHL_1800 | R18 (2004) release |
| kDHL_2100a | 26 | R21 (2007) beta |
| kDHL_1021 | 27 | R21 (2007) release |
| vAC21 | kDHL_1021 | R21 (2007) release |
| kDHL_2400a | 28 | R24 (2010) beta |
| kDHL_1024 | 29 | R24 (2010) release |
| vAC24 | kDHL_1024 | R24 (2010) release |
| kDHL_2700a | 30 | R27 (2013) beta |
| kDHL_1027 | 31 | R27 (2013) release |
| vAC27 | kDHL_1027 | R27 (2013) release |
| kDHL_3200a | 32 | R32 (2018) beta |
| kDHL_1032 | 33 | R32 (2018) release |
| vAC32 | kDHL_1032 | R32 (2018) release |