ObjectArx 2023 Upgradation (ObjectArx 2022 to ObjectArx 2023 upgradation issue)

ObjectArx 2023 Upgradation (ObjectArx 2022 to ObjectArx 2023 upgradation issue)

milindnalgirkar
Enthusiast Enthusiast
355 Views
2 Replies
Message 1 of 3

ObjectArx 2023 Upgradation (ObjectArx 2022 to ObjectArx 2023 upgradation issue)

milindnalgirkar
Enthusiast
Enthusiast

Dear member,

We tried to upgrade ObjectArx 2022 to 2023 and we got issue in deprecated API

 

API (ObjectArx 2022 and Deprecated ObjectArx API 2023):

milindnalgirkar_0-1664611601240.png

 

We got following error for that upgradation:

 

milindnalgirkar_1-1664611864800.png

 

Kindly Guide Us For The Same.

 

Thanks In Advance!!

 

Thanks & regards,

--

0 Likes
356 Views
2 Replies
Replies (2)
Message 2 of 3

moogalm
Autodesk Support
Autodesk Support

We added new API getDocumentIterator to make it easier to write AutoCAD code that doesn't leak resources. The normal C++ idiom for avoiding resource leaks is RAII, and the STL provides the std::unique_ptr class that handles automatic deletion of wrapped pointers. Please use this API.

 

 

for (auto pI = ::acDocManager->getDocumentIterator(); !pI->done(); pI->step())
    {
        AcApDocument* pApiDoc = pI->document();
 /**other code**/
     }

 

 

 

0 Likes
Message 3 of 3

daniel_cadext
Advisor
Advisor

I think it’s a great Idea, however the documentation is ambiguous.

“auto getDocumentIterator();
Returns a new pointer to an AcApDocumentIterator object.”


should define exactly what auto is

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes