Share
 
 

Proxy Object Life Cycle

Proxy objects are created by AutoCAD when it reads a file containing custom objects that cannot be instantiated. Custom objects cannot be instantiated when the parent application is not loaded and cannot be demand loaded. If the parent application is subsequently loaded during the drawing session (by command, for example), AutoCAD automatically converts the proxy objects to custom objects.

A proxy may be thought of as a wrapper containing a custom object. A proxy provides AutoCAD with access to the base class elements (such as color and layer) of the custom object, and it encapsulates the custom class's data members that cannot be accessed in the absence of the parent application. Under most circumstances, the proxy wrapper is shed when the drawing database is written to a file. The same binary object that was read in is written out. If the save operation involves converting the file type between DWG and DXF (for which the conversion function of the parent application is not present), the proxy wrapper is saved with the custom binary data as well.

When the parent application is not loaded before writing to a file, the data is handled as follows:

  • If the input and output files are the same file type (both DWG or DXF), no translation operation is necessary, and the same data that was read in is written out. The data stored in the proxy object is written to the output file.
  • If the input and output files differ in file type (that is, DWG in and DXF out, or vice versa), the format cannot be translated because the translation function defined by the parent application is not present. The entire proxy object is therefore written to the output file. When the file is subsequently read by AutoCAD, the proxy will either convert to a custom object (in the presence of the parent application), or remain a proxy in memory (in the absence of the parent application).

Was this information helpful?