Share

ObjectARX Migration Guide

Description

Information about how to update existing ObjectARX® applications to work with AutoCAD® 2022 is provided here.

AutoCAD 2022 is a binary compatibility release and ObjectARX applications developed for AutoCAD 2021 shouldn't need to be recompiled. Applications developed for AutoCAD 2020 and earlier releases will need to be recompiled. The following sections list API changes made to this release. If your application uses any of these APIs, you will need to update your code accordingly.

Changed ObjectARX API

Topic
Class
Previous Class
Declaration
Previous Declaration
AcAxMatrix3d
AcAxMatrix3d& operator =(const SAFEARRAY* safeArrayPt);
AcAxMatrix3d& operator=(const SAFEARRAY* safeArrayPt) throw(HRESULT);
AcAxMatrix3d
AcAxMatrix3d& operator =(const VARIANT& var);
AcAxMatrix3d& operator=(const VARIANT& var) throw(HRESULT);
AcAxMatrix3d
AcAxMatrix3d& operator =(const VARIANT* var);
AcAxMatrix3d& operator=(const VARIANT* var) throw(HRESULT);
AcAxMatrix3d
AcAxMatrix3d(const SAFEARRAY* safeArrayPt);
AcAxMatrix3d(const SAFEARRAY* safeArrayPt) throw(HRESULT);
AcAxMatrix3d
AcAxMatrix3d(const VARIANT& var);
AcAxMatrix3d(const VARIANT& var) throw(HRESULT);
AcAxMatrix3d
AcAxMatrix3d(const VARIANT* var);
AcAxMatrix3d(const VARIANT* var) throw(HRESULT);
AcAxPoint2d
AcAxPoint2d& operator =(const SAFEARRAY* safeArrayPt);
AcAxPoint2d& operator=(const SAFEARRAY* safeArrayPt) throw(HRESULT);
AcAxPoint2d
AcAxPoint2d& operator =(const VARIANT& var);
AcAxPoint2d& operator=(const VARIANT& var) throw(HRESULT);
AcAxPoint2d
AcAxPoint2d& operator =(const VARIANT* var);
AcAxPoint2d& operator=(const VARIANT* var) throw(HRESULT);
AcAxPoint2d
AcAxPoint2d(const VARIANT& var);
AcAxPoint2d(const VARIANT& var) throw(HRESULT);
AcAxPoint2d
AcAxPoint2d(const SAFEARRAY* safeArrayPt);
AcAxPoint2d(const SAFEARRAY* safeArrayPt) throw(HRESULT);
AcAxPoint2d
AcAxPoint2d(const VARIANT* var);
AcAxPoint2d(const VARIANT* var) throw(HRESULT);
AcAxPoint2d
SAFEARRAY* asSafeArrayPtr() const;
SAFEARRAY* asSafeArrayPtr() const throw(HRESULT);
AcAxPoint2d
VARIANT* asVariantPtr() const;
VARIANT* asVariantPtr() const throw(HRESULT);
AcAxPoint2d
VARIANT& setVariant(VARIANT& var) const;
VARIANT& setVariant(VARIANT& var) const throw(HRESULT);
AcAxPoint2d
VARIANT* setVariant(VARIANT* var) const;
VARIANT* setVariant(VARIANT* var) const throw(HRESULT);
AcAxPoint2dArray
AcAxPoint2dArray& append(const VARIANT* var);
AcAxPoint2dArray& append(const VARIANT* var) throw(HRESULT);
AcAxPoint2dArray
AcAxPoint2dArray& append(const VARIANT& var);
AcAxPoint2dArray& append(const VARIANT& var) throw(HRESULT);
AcAxPoint2dArray
AcAxPoint2dArray& append(const SAFEARRAY* safeArrayPt);
AcAxPoint2dArray& append(const SAFEARRAY* safeArrayPt) throw(HRESULT);
AcAxPoint2dArray
SAFEARRAY* asSafeArrayPtr() const;
SAFEARRAY* asSafeArrayPtr() const throw(HRESULT);
AcAxPoint2dArray
VARIANT& setVariant(VARIANT& var) const;
VARIANT& setVariant(VARIANT& var) const throw(HRESULT);
AcAxPoint2dArray
VARIANT* setVariant(VARIANT* var) const;
VARIANT* setVariant(VARIANT* var) const throw(HRESULT);
AcAxPoint3d
AcAxPoint3d& operator =(const VARIANT* var);
AcAxPoint3d& operator=(const VARIANT* var) throw(HRESULT);
AcAxPoint3d
AcAxPoint3d& operator =(const VARIANT& var);
AcAxPoint3d& operator=(const VARIANT& var) throw(HRESULT);
AcAxPoint3d
AcAxPoint3d& operator =(const SAFEARRAY* safeArrayPt);
AcAxPoint3d& operator=(const SAFEARRAY* safeArrayPt) throw(HRESULT);
AcAxPoint3d
AcAxPoint3d(const VARIANT& var);
AcAxPoint3d(const VARIANT& var) throw(HRESULT);
AcAxPoint3d
AcAxPoint3d(const VARIANT* var);
AcAxPoint3d(const VARIANT* var) throw(HRESULT);
AcAxPoint3d
AcAxPoint3d(const SAFEARRAY* safeArrayPt);
AcAxPoint3d(const SAFEARRAY* safeArrayPt) throw(HRESULT);
AcAxPoint3d
SAFEARRAY* asSafeArrayPtr() const;
SAFEARRAY* asSafeArrayPtr() const throw(HRESULT);
AcAxPoint3d
VARIANT* asVariantPtr() const;
VARIANT* asVariantPtr() const throw(HRESULT);
AcAxPoint3d
VARIANT* setVariant(VARIANT* var) const;
VARIANT* setVariant(VARIANT* var) const throw(HRESULT);
AcAxPoint3d
VARIANT& setVariant(VARIANT& var) const;
VARIANT& setVariant(VARIANT& var) const throw(HRESULT);
AcAxPoint3dArray
AcAxPoint3dArray& append(const VARIANT* var);
AcAxPoint3dArray& append(const VARIANT* var) throw(HRESULT);
AcAxPoint3dArray
AcAxPoint3dArray& append(const VARIANT& var);
AcAxPoint3dArray& append(const VARIANT& var) throw(HRESULT);
AcAxPoint3dArray
AcAxPoint3dArray& append(const SAFEARRAY* safeArrayPt);
AcAxPoint3dArray& append(const SAFEARRAY* safeArrayPt) throw(HRESULT);
AcAxPoint3dArray
SAFEARRAY* asSafeArrayPtr() const;
SAFEARRAY* asSafeArrayPtr() const throw(HRESULT);
AcAxPoint3dArray
VARIANT& setVariant(VARIANT& var) const;
VARIANT& setVariant(VARIANT& var) const throw(HRESULT);
AcAxPoint3dArray
VARIANT* setVariant(VARIANT* var) const;
VARIANT* setVariant(VARIANT* var) const throw(HRESULT);
template <class ACDB_CLASS, getClassDescFuncType ACDB_GET_CLASS_DESC=ACDB_CLASS::desc> inline Acad::ErrorStatus accessAcDbObjectForRead(ACDB_CLASS*& pObj, AcDbObjectId id, bool& bWasOpened, bool bOpenErased = false);
template <class ACDB_CLASS> inline Acad::ErrorStatus accessAcDbObjectForRead(ACDB_CLASS * & pObj, AcDbObjectId id, bool & bWasOpened, bool bOpenErased = false);
template<> inline Acad::ErrorStatus accessAcDbObjectForRead<AcDbObject>(AcDbObject * & pObj, AcDbObjectId id, bool& bWasOpened, bool bOpenErased);
AcDbAssocDependencyPE
virtual ACDBCORE2D_PORT bool allowsDependencies(const AcDbObject* pObject, bool isWriteDependency, const AcRxClass* pActionBodyOrActionClass, const AcDbAssocDependency* pDependency, const AcRxObject* pContext) const = 0;
virtual ACDBCORE2D_PORT bool allowsDependencies(const AcDbObject* pObject,bool isWriteDependency,const AcRxClass* pActionBodyOrActionClass,const AcDbAssocDependency* pDependency,const AcRxObject* pContext) const = NULL;AutoCAD 2011 through 2021virtual bool allowsDependencies(const AcDbObject* pObject, bool isWriteDependency) const;
AcDbDatabase
ACDBCORE2D_PORT Acad::ErrorStatus dxfOut(const ACHAR* fileName, int precision = 16, AcDb::AcDbDwgVersion dwgVer = AcDb::kDHL_CURRENT, bool saveThumbnailImage = false);
Acad::ErrorStatus dxfOut(const ACHAR* fileName, int precision = 16, AcDb::AcDbDwgVersion dwgVer = AcDb::kDHL_CURRENT, bool saveThumbnailImage = false);
AcDbObject
virtual ACDBCORE2D_PORT Acad::ErrorStatus deepClone(AcDbObject* pOwnerObject, AcDbObject*& pClonedObject, AcDbIdMapping& idMap, bool isPrimary = true) const;
ACDBCORE2D_PORT ADESK_SEALED_VIRTUAL Acad::ErrorStatus deepClone(AcDbObject* pOwnerObject, AcDbObject*& pClonedObject, AcDbIdMapping& idMap, Adesk::Boolean isPrimary = true) const;
AcDbObject
virtual ACDBCORE2D_PORT Acad::ErrorStatus wblockClone(AcRxObject* pOwnerObject, AcDbObject*& pClonedObject, AcDbIdMapping& idMap, bool isPrimary = true) const;
ACDBCORE2D_PORT ADESK_SEALED_VIRTUAL Acad::ErrorStatus wblockClone(AcRxObject* pOwnerObject, AcDbObject*& pClonedObject, AcDbIdMapping& idMap, Adesk::Boolean isPrimary = true) const;
template <class ACDB_CLASS, getClassDescFuncType ACDB_GET_CLASS_DESC=ACDB_CLASS::desc>class AcDbSmartObjectPointer;
template <class ACDB_CLASS> class AcDbSmartObjectPointer;
ACAD_PORT bool acedIsUpdateDisplayPaused();
bool acedIsUpdateDisplayPaused (void);
AcEditorReactor
virtual ACCORE_PORT ~AcEditorReactor();
ACAD_PORT virtual ~AcEditorReactor();
ACAD_PORT void acedUpdateDisplayPause(bool bEnable);
void acedUpdateDisplayPause (bool bEnable);
struct HtmlWindowOptions { enum HtmlWindowFlags { eAllowResize = 0x0001, eAllowMinimize = 0x0002, eAllowMaximize = 0x0004, eInitPosition = 0x0008, eInitSize = 0x0010, eMaxSize = 0x0020, eMinSize = 0x0040, ePersistSizeAndPosition = 0x0080, eCenterWindow = 0x0100, eDialogFrame = 0x0200, eAutoHiDpiScale = 0x0400 }; UINT flags; UINT x; UINT y; UINT width; UINT height; UINT maxWidth; UINT maxHeight; UINT minWidth; UINT minHeight; UINT dialogTemplateId;};
struct HtmlWindowOptions {enum HtmlWindowFlags {eAllowResize = 0x0001, // allow dialog to be resizableeAllowMinimize = 0x0002, // enable minimize buttoneAllowMaximize = 0x0004, // enable maximize buttoneInitPosition = 0x0008, // specify initial position (x and y fields are used)eInitSize = 0x0010, // specify initial size (width and height fields are used)eMaxSize = 0x0020, // specify maximum size (maxWidth and maxHeight fields are used)eMinSize = 0x0040, // specify minimum size (minWidth and minHeight fields are used)ePersistSizeAndPosition = 0x0080 // allow dialog size and position to be persisted in registry};UINT flags;UINT x;UINT y;UINT width;UINT height;UINT maxWidth;UINT maxHeight;UINT minWidth;UINT minHeight;};
template <class ACDB_CLASS, getClassDescFuncType ACDB_GET_CLASS_DESC=ACDB_CLASS::desc>class ReadableAcDbObject;
template <class ACDB_CLASS> class ReadableAcDbObject;

Deprecated ObjectARX API

Topic
Class
Declaration
Use Instead
ACCORE_PORT Adesk::Boolean acgsDrawableCached(AcGiDrawable * pDrawable);
acgsDrawableCached(AcGsGraphicsKernel* pKernel, AcGiDrawable* pDrawable);
ACCORE_PORT AcGsModel* acgsGetGsHighlightModel(const AcDbDatabase* pDb);
acgsGetGsHighlightModel(AcGsGraphicsKernel* pKernel, const AcDbDatabase* pDb);
ACCORE_PORT AcGsModel* acgsGetGsModel(const AcDbDatabase* pDb);
acgsGetGsModel(AcGsGraphicsKernel* pKernel, const AcDbDatabase* pDb);
AcGsManager
virtual AcGsModel* gsModel(const AcDbDatabase* pDb) const = 0;
AcGsManager2::gsModel(AcGsGraphicsKernel* pKernel, const AcDbDatabase* pDb);
AcGsManager
virtual bool hasGsModel(const AcDbDatabase* pDb) const = 0;
AcGsManager2::hasGsModel(AcGsGraphicsKernel* pKernel, const AcDbDatabase* pDb);
AcGsManager
virtual void setGsHighlightModel(const AcDbDatabase* pDb, AcGsModel* pModel) = 0;
AcGsManager2::gsHighlightModel(AcGsGraphicsKernel* pKernel, const AcDbDatabase* pDb);
AcGsManager
virtual void setGsModel(const AcDbDatabase* pDb, AcGsModel* pModel) = 0;
AcGsManager2::setGsModel(AcGsGraphicsKernel* pKernel, const AcDbDatabase* pDb, AcGsModel* pModel);
ACCORE_PORT void acgsSetGsHighlightModel(const AcDbDatabase* pDb, AcGsModel* pModel);
acgsSetGsHighlightModel(AcGsGraphicsKernel* pKernel, const AcDbDatabase* pDb, AcGsModel* pModel);
ACCORE_PORT void acgsSetGsModel(const AcDbDatabase* pDb, AcGsModel* pModel);
acgsSetGsModel(AcGsGraphicsKernel* pKernel, const AcDbDatabase* pDb, AcGsModel* pModel);
AcRxClass
ACBASE_PORT AcRxObject* queryX(const AcRxClass*);
ACBASE_PORT AcRxObject* queryX(const AcRxClass*) const;

Removed ObjectARX API

Class
Declaration
Use Instead
AcApDocManager
ACCORE_PORT Acad::ErrorStatus appContextOpenPackage(const ACHAR *pszPackageName);
No alternative or replacement.
Global
ACDBCORE2D_PORT ACHAR * acdbXStrSave(ACHAR * pSource, ACHAR ** pDest);
No alternative or replacement.
Global
ACDBCORE2D_PORT int acdbXStrCase(ACHAR * str, size_t strLen);
No alternative or replacement.

Changed Enum

Topic
Declaration
Previous Declaration
enum HtmlWindowFlags { eAllowResize = 0x0001, eAllowMinimize = 0x0002, eAllowMaximize = 0x0004, eInitPosition = 0x0008, eInitSize = 0x0010, eMaxSize = 0x0020, eMinSize = 0x0040, ePersistSizeAndPosition = 0x0080, eCenterWindow = 0x0100, eDialogFrame = 0x0200, eAutoHiDpiScale = 0x0400};
enum HtmlWindowFlags {eAllowResize = 0x0001,eAllowMinimize = 0x0002,eAllowMaximize = 0x0004,eInitPosition = 0x0008,eInitSize = 0x0010,eMaxSize = 0x0020,eMinSize = 0x0040,ePersistSizeAndPosition = 0x0080};

Was this information helpful?