AcroPlot Advanced API

To create or convert files using the command line mode API or ActiveX automation mode interface, it is required to purchase a license of AcroPlot Auto for each server running the process. If there will be additional PC's running AcroPlot Suite licenses or any of its components, then it is also required to purchase the number licenses needed in addition to the AcroPlot Auto server license.
 
 

Notes:

1.
If the sOutputFilename exists the PDF files will be merged to it.
2.
If the sOutputFilename is read-only or is opened in Adobe Acrobat or Adobe Reader the conversion will fail.
3.
If the RestoreSettings is not called or provided a proper settings name then the last used settings in AcroPlot Jr. will be used.
4.
If you are merging multiple layouts or drawings into the same PDF make sure that you turn off the OpenPDF setting by using:
SetSetting "AcroPlotSettings.OpenPDF" 0
 
 
 

The Basic API Calls are:

Please see the AcroPlot Standard API Section for the basic API calls and how to initial the AcroPlot.AcroPlotApplication interface.
 
 

The Advacned API Calls for AcroPlot Auto customers or customers with a 25 or more AcroPlot Pro license are:

AcadApp() As Object
This property gets or sets the AutoCAD Application object to use for the conversion.  This is a standard COM generic object type.
 
To set the current AutoCAD Application for AcroPlot to use for conversion.
Dim oAcadObject As Object
Dim oAcroPlotApp As Object
Set oAcroPlotApp = CreateObject("AcroPlot.AcroPlotApplication")
Set oAcadObject = CreateObject("AutoCAD.AcroPlotApplication")
Set oAcroPlotApp.AcadApp = oAcadObject
To get the current AcadApp object from AcroPlot
Set oAcadObject = oAcroPlotApp.AcadApp
 
AcadDoc() As Object
This property gets or sets the AutoCAD Document object to use for the conversion.  This is a standard COM generic object type.
 
StartAutoCAD() As Object
This method starts the version of AutoCAD as defined by the ConvertWith value and returns the standard COM object for the AutoCAD.Application if it succeeds.  If that fails then it tries to start the last used version of AutoCAD and returns the AutoCAD.Application if it succeeds.  Otherwise returns Nothing.
 
SetSetting("AcroPlotSettings.ConvertWith", ByVal sAutoCADProgram As string)
This is a special case of the SetSetting standard API call which allows users converting files outside of AutoCAD with the Convert function to specify the version or flavor of AutoCAD for us to use.  This would be be the string value as shown in the AcroPlot interface like "AutoCAD 2011" or "AutoCAD 2012 - English".  This changes based on versions, flavors, and languages of AutoCAD so it's best to start AcroPlot and look for the values in the Convert With drop down.
 
SetDWGConvertFrom(ByVal vConvertFrom  As Variant) As Long
This method specifies what to convert from the DWG file when you use the Convert method.
Standard input would be a long value based on what you want to convert.
0 = Current layout either modelspace or paperspace
1 = Modelspace
2 = Current Paperspace layout
3 = All Paperspace layouts in order
4 = All Modelspace views
5 = All Paperspace views
 
SetUseDWGViewer(ByVal bUseViewer As Boolean) As Long
Set to True if you want to use our direct conversion routines instead of AutoCAD for the DWG conversion.
 
Convert(ByVal sInputFilename As String, _
           ByVal sOutputFilename As String,
           Optional ByVal bModal As Boolean = False,
           Optional ByVal lOutputformat As Long = 0,
           Optional ByVal bTerminateAtEnd As Boolean = False) As Boolean
This method converts the file to the specified output either by the extension on the sOutputFilename or by the lOutputFormat specified.
sInputFilename is the full filename of the file that you want to convert.  Accepts all supported input formats.
 
sOutputFilename is the full filename of the file that you want to create.
 
bModal is an optional parameter if you want the conversion to be modal or modeless.  If modal (True) it will not return control to your application until the conversion is finished.  If modeless (False) it will return control to your application almost immediately and you will be responsible for watching for the conversion to finish before starting another one.
 
lOutputFormat is the output format which you would like to convert to.  Typically this can be 0 and we will determine the format based off from the file extension of the sOutputFilename.  But in the case of tiff files where it could be either monochrome or color you would want to specifically tell us which format to use.
 
bTerminateAtEnd - If set to True this will close the AutoCAD and AcroPlot application and release it at the end of the conversion.  It is not recommended to do it this way with some programming languages because an error may occur since the object reference might be lost to the AcroPlot.AcroPlotApplication.  Please use the Quit() method instead.
The values for the various output formats are:
   pdf = 1
   dwf6 = 2
  'reserved for future use
   BMP = 4
   CAL = 5
   GIF = 6
   gp4 = 7
   JPG = 8
   PNG = 9
   tif = 10 (color tiff at 100 dpi)
   tifmono = 11 (monochrome group 3 fax format tiff at 100 dpi)
   tifmono200 = 12 (monochrome group 3 fax format tiff at 200 dpi)
   tifmono300 = 13 (monochrome group 3 fax format tiff at 300 dpi)
   tifmono400 = 14 (monochrome group 3 fax format tiff at 400 dpi)
   tif200 = 15 (color tiff at 200 dpi)
   tif300 = 16    'not supported reserved for future use
   tif400 = 17    'not supported reserved for future use
   dwfpdf = 18
   dwfpdftif = 19
   dwfpdftifmono = 20
   dwfpdftifmono200 = 21
   dwfpdftifmono300 = 22
   dwfpdftifmono400 = 23
   pdftif = 24
   pdftifmono = 25
   pdftifmono200 = 26
   pdftifmono300 = 27
   pdftifmono400 = 28
   'reserved for future use
   rasterpdf100 = 30    'not supported reserved for future use
   rasterpdf150 = 31    'not supported reserved for future use
   rasterpdf200 = 32    'not supported reserved for future use
   rasterpdf300 = 33    'not supported reserved for future use
   rasterpdf400 = 34    'not supported reserved for future use
   rasterpdfmono100 = 35    'not supported reserved for future use
   rasterpdfmono150 = 36    'not supported reserved for future use
   rasterpdfmono200 = 37    'not supported reserved for future use
   rasterpdfmono300 = 38    'not supported reserved for future use
   rasterpdfmono400 = 39    'not supported reserved for future use
   tif600 = 40    'not supported reserved for future use
   tifmono600 = 41    (monochrome group 3 fax format tiff at 600 dpi)  'not supported reserved for future use
   dwfpdftifmono600 = 42    'not supported reserved for future use
   pdftifmono600 = 43    'not supported reserved for future use
   rasterpdf600 = 44    'not supported reserved for future use
   rasterpdfmono600 = 45    'not supported reserved for future use
   cal200 = 46    'not supported reserved for future use
   cal400 = 47    'not supported reserved for future use
   cal600 = 48    'not supported reserved for future use
   gp4200 = 49    'not supported reserved for future use
   gp4400 = 50    'not supported reserved for future use
   gp4600 = 51    'not supported reserved for future use
   cal300 = 52    'not supported reserved for future use
   gp4300 = 53    'not supported reserved for future use
   dwfx = 54    'not supported reserved for future use
 
 
 
GetFilesCreated() As Variant
This method returns a string array of the files created during the conversion.
 
 
GetFilesCreatedAsString() As String
This method returns a string of the files created during the conversion separated by a semicolon.
 
 
GetAPIError() As String
This method returns the error string if an error occurs during the current Convert call.  This is the same as checking the registry for the value at HKEY_CURRENT_USER\Software\CADzation\ACROPLOT\API.Error.
 
EndAutoCAD()
This method ends the instance of AutoCAD that is defined by the AcadApp in AcroPlot and properly releases all objects.  This is useful if you want to close AutoCAD after say 100 or 200 conversions to clean up AutoCAD's own memory usage.
 
Quit()
This method properly quits the AcroPlot.Application object and releases all references. It is recommended that you restart AutoCAD every hundred drawings of so if you are batching with the Convert Method.
 

Registry Setting to Watch for Conversion Status

 

If you call the Convert method with the bModal=False then we will return control to your program immediately.  In this case you would want to put a loop in your code to watch for use to write the value to the registry that we have finished the conversion.  A value of 1 means that the conversion has finished.
The registry key where we wri
HKEY_CURRENT_USER\Software\CADzation\ACROPLOT\API.ConversionFinished  (REG_SZ)  0=Working, 1=Finished Successfully, -1=Finished but failed to create output file.
 
 
There are 3 other values that we write to the registry that might also be helpful for those using the Convert Method.
HKEY_CURRENT_USER\Software\CADzation\ACROPLOT\API.Error  (REG_SZ)
HKEY_CURRENT_USER\Software\CADzation\ACROPLOT\API.Hwnd_AutoCAD  (REG_SZ)
HKEY_CURRENT_USER\Software\CADzation\ACROPLOT\API.ResultFilename   (REG_SZ)