A proxy object is a substitute object that holds subdata for custom objects that cannot be loaded because the custom object's parent application is also not loaded.
The proxy object is a wrapper around the custom object which provides access to the base class properties, such as color, layer, linetype, and lineweight. The proxy object also encapsulates all of a custom class's data members that can only be accessed if the parent application is loaded.
Proxies can be created for both custom entities and custom objects in the OdDbProxyEntity and OdDbProxyObject classes, which are each derived from OdDbEntity and OdDbObject.
While reading a drawing file with custom objects, if the parent application is not loaded yet, an attempt to load the application is made (see the DEMANDLOAD system variable). If the application is not available, custom objects can't be loaded and proxies are created.
While saving a drawing with proxy objects to a file, there are two possible cases:
While a drawing file with proxy objects is loaded, there are two possible cases:
While rendering proxy entities, the custom entity's worldDraw() and viewportDraw() functions can't be used because the parent application is not available.
For rendering proxy entities, Drawings SDK uses the entity's graphics metafile. This metafile is generated using the custom entity's worldDraw() or saveAs() functions at the moment when the file with the custom entity is saved. So, metafile contents completely depends on implementation of these functions.
Display mode of proxy entities is defined by the value of the PROXYSHOW system variable.
Proxies provide limited editing functionality.
Operations that are allowed when a custom entity is a proxy are defined in the parent application.
Basic operations of changing linetype and linetype scale, color, layer, and visibility can be performed for a proxy entity and will be written out as a part of the OdDbEntity data.
Transformation operations such as move, rotate, and scale cannot be applied to the custom object until the drawing file with the transformed proxy entity is opened by the parent application. When transformations are applied to a proxy entity, they transform a graphics metafile, and a copy of the transformation matrix is saved in a custom record in the proxy entity's extension dictionary. Multiple transformations update the transformation matrix. As a result, this matrix stores the cumulative transformation's data. When you open a drawing file, the parent application calls the entity's transformBy() function and passes it the transformation matrix data that applied to the custom object. The custom data storage record is removed from the extension dictionary.
Proxy entities can be exploded using Drawings SDK standard exploding functions and are exploded using the contents of the proxy entity's graphics metafile. For more details, see Exploding Entities.
Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.
|