To implement your custom class, use one of these three macros in the source file:
Use for abstract classes and any other classes that should not be instantiated.
Use for transient classes that can be instantiated but are not written to file.
Use for classes that can be written to, or read from, DWG and DXF files. Each of these macros defines the following:
For AsdkPoly, the following line expands to a very long single line of code:
ACRX_DXF_DEFINE_MEMBERS(AsdkPoly, AcDbCurve, AcDb::kDHL_CURRENT,\ AcDb::kMReleaseCurrent, 0, POLYGON, /*MSG0*/"AutoCAD");
When reformatted to multiple lines for clarity, the line looks like this:
AcRxClass* AsdkPoly::desc() { if (AsdkPoly::gpDesc != 0) return AsdkPoly::gpDesc; return AsdkPoly::gpDesc = (AcRxClass*)((AcRxDictionary*)acrxSysRegistry()-> at("ClassDictionary"))->at("AsdkPoly"); } AcRxClass* AsdkPoly::isA() const { return AsdkPoly::desc(); } AcRxClass* AsdkPoly::gpDesc = 0; static AcRxObject * makeAsdkPoly() { return new AsdkPoly(); } void AsdkPoly::rxInit() { if (AsdkPoly::gpDesc != 0) return; AsdkPoly::gpDesc = newAcRxClass("AsdkPoly", "AsdkCurve", AcDb::kDHL_CURRENT, AcDb::kMReleaseCurrent, 0, &makeAsdkPoly, "POLYGON", "\"AutoCAD\""); };
When expanded, the semicolon (;) at the end of the macro call line moves to just after the closing brace (}) for a function definition. Therefore, this semicolon is not required for this macro call line.
If you want to write your own rxInit() function, use the ACRX_DEFINE_MEMBERS() macro by itself, which defines desc(), cast(), and isA() for your class but does not define the rxInit() function. This macro also does not create the associated AcRxClass object, which is the responsibility of the rxInit() function.