Check unclosed objects

williamtuw
Observer
Observer

Check unclosed objects

williamtuw
Observer
Observer

Hi everyone!
    Is there a way to find those unclosed objects? Every time there is an error: "One or more objects in this drawing cannot be saved to the specified format", I know that some objects were forgot to close, but I don't find a way to output those objects. I know that the command "AUDIT" can fix this issue than I can save dwg successfully, but next time it happens again.
    I going to write a sample debug tool than could traverse the database, before that, I wish there would be an existed tool can do the same thing!

Thank you!

 

 

0 Likes
Reply
402 Views
1 Reply
Reply (1)

daniel_cadext
Advisor
Advisor

It’s the code’s responsibility to close objects. If you’re having trouble, you might consider using one of the smart pointer options

AcDbObjectPointer, AcDbSmartObjectPointer.

Running around and closing objects seems like a crash waiting to happen.

Also, you can write custom deletors for other objects, I use the heck out of this one..

 

using AcResBufPtr = std::unique_ptr < resbuf, decltype([](resbuf* ptr) noexcept
    {
        acutRelRb(ptr);
    }) > ;
Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes