C++
#define ACRX_DXF_DEFINE_MEMBERS(CLASS_NAME,PARENT_CLASS,DWG_VERSION,\ MAINTENANCE_VERSION,PROXY_FLAGS,DXF_NAME,APP) \ ACRX_DEFINE_MEMBERS(CLASS_NAME); \ void CLASS_NAME::rxInit() { \ ACRX_STATIC_CHECK(CLASS_NAME); \ ADESK_SUPPRESS_DEPRECATED \ gpDesc = newAcRxClass(ACRX_T(#CLASS_NAME), ACRX_T(#PARENT_CLASS), \ DWG_VERSION,MAINTENANCE_VERSION,PROXY_FLAGS, \ &acrxInstantiateClass<CLASS_NAME>, ACRX_T(#DXF_NAME), ACRX_T(#APP)); \ } \ void CLASS_NAME::rxInit(AppNameChangeFuncPtr ptr) { \ ACRX_STATIC_CHECK(CLASS_NAME); \ ADESK_SUPPRESS_DEPRECATED \ gpDesc = newAcRxClass(ACRX_T(#CLASS_NAME), ACRX_T(#PARENT_CLASS), \ DWG_VERSION,MAINTENANCE_VERSION,PROXY_FLAGS, \ &acrxInstantiateClass<CLASS_NAME>, ACRX_T(#DXF_NAME), ACRX_T(#APP), ptr); \ }
File
rxboiler.h
Description
This macro (or code equivalent to what it expands to) must be used by all classes whose objects will be stored in an AcDbDatabase.
The CLASS_NAME argument must be the name of the class in whose declaration the macro is included. The PARENT_CLASS argument must be the name of the CLASS_NAME base class that is in the ObjectARX run-time tree.
When registering classes using these macros, you need to provide dwg and maintenance release version numbers. The DWG_VERSION and MAINTENANCE_VERSION arguments are mandatory, and there is no default. These data members are not persistent; in other words, they are not written to the dwg/dxf files. These version numbers are used in the AcDbObject member functions getObjectBirthVersion(), getObjectSaveVersion(), hasSaveVersionOverride(), and setHasSaveVersionOverride() to allow objects to override the filer version and dictate which version they need to be saved as. For more information about object version support, see the ObjectARX Developer's Guide.
The ProxyFlags argument is an integer whose bits are flags used to control what editing operations will be allowed on AcDbProxyObjects or AcDbProxyEntities that contain objects of the class CLASS_NAME. The DXF_NAME argument is used as the name string for group code 0 in DXF files and in AutoLISP entity list information. It does not need to be the same as the CLASS_NAME.
The APP argument is stored in the CLASSES section of DXF files that contain objects of the class. It is used in message boxes posted when the class is not present in the run-time tree and objects of the class are encountered. The APP argument can handle comments. You may include multiple strings, separated by the | character. The only restriction is that the first string must be a unique "application identification" string (use your developer prefix as part of it). If you set up system registry entries for demand loading, the identification string must be used as the registry key for the application's entry under the "Applications" key in the AutoCAD registry section (this would be the logicalName argument when using the acrxRegisterApp() function to write the registry information).
Any comment strings that you include in APP will be displayed by the LIST command, and in the Proxy Information Dialog box. For example, you might set the APP argument to "AsdkPolyCAD|Product Desc: PolyCAD ObjectARX App for Polygon Entity|Company:Autodesk, Inc.|WEB Address: www.autodesk.com".
For classes not derived from AcDbEntity (that is, no graphics) the PROXY_FLAGS argument should be either AcDbProxyObject::kNoOperation (integer value 0) or AcDbProxyObject::kEraseAllowed (integer value 1):
For classes derived from AcDbEntity (either directly or indirectly), the PROXY_FLAGS argument may be either AcDbProxyEntity::kNoOperation (integer value 0) or a bit-wise combination of the following values:
AcDbProxyEntity::kEraseAllowed = 0x1 AcDbProxyEntity::kTransformAllowed = 0x2 AcDbProxyEntity::kColorChangeAllowed = 0x4 AcDbProxyEntity::kLayerChangeAllowed = 0x8 AcDbProxyEntity::kLinetypeChangeAllowed = 0x10 AcDbProxyEntity::kLinetypeScaleChangeAllowed = 0x20 AcDbProxyEntity::kVisibilityChangeAllowed = 0x40 AcDbProxyEntity::kCloningAllowed = 0x80 AcDbProxyEntity::kLineWeightChangeAllowed = 0x100 AcDbProxyEntity::kPlotStyleNameChangeAllowed = 0x200 or AcDbProxyEntity::kAllButCloningAllowed = 0x37F AcDbProxyEntity::kAllAllowedBits = 0x3FF
Any of these values can be combined with AcDbProxyEntity::kDisableProxyWarning = 0x400.
If PROXY_FLAGS is kNoOperation, then proxyEntities containing entities of this class will not be erasable, nor transformable, nor will they be able to have their color, layer, linetype, linetypeScale, or visibiliity changed, and they will not be able to be copied. However, they can be exploded.
The macro uses the ACRX_DEFINE_MEMBERS macro to define desc(), isA(), and gpDesc. In addition it also defines:
static AcRxObject * make<ClassName>() CLASS_NAME::rxInit()
None of the arguments should be in quotes. If quotes are used, they will be treated as part of the actual string. Also, the arguments are case-sensitive.
The DXFNAME argument must be all uppercase or it will not be possible to DXFIN a file containing objects of the class.
Note When used, this macro does not need to be terminated by a semicolon (';'), but it may be used without any problems:
ACRX_DXF_DEFINE_MEMBERS(CLASS_NAME,PARENT_CLASS,DWG_VERSION, MAINTENANCE_VERSION,PROXY_FLAGS,DXF_NAME,APP)
or
ACRX_DXF_DEFINE_MEMBERS(CLASS_NAME,PARENT_CLASS,DWG_VERSION, MAINTENANCE_VERSION,PROXY_FLAGS,DXF_NAME,APP);
CLASS_NAME : Input name of the class being declared PARENT_CLASS : Input name of the ObjectARX tree-resident base class DWG_VERSION : Input major version number (DWG version) in which the class was introduced MAINTENANCE_VERSION : Input minor version number (maintenance release version) in which the class was introduced PROXY_FLAGS : Input proxy flag bits for this class DXF_NAME : Input DXF name (must be all uppercase) APP : Input application name