It’s a little weird from a memory perspective, so I can see a reason why Autodesk may have not implemented this
AcDbPointRef cannot be garbage collected after it’s added AcDbDimAssoc, otherwise it will crash.
Oda uses reference counting, I have a flag in Python’s analog to DisposableWrapper to handoff ownership in setPointRef
void PyDbDimAssoc::setPointRef(int ptType, PyDbPointRef& ptRef)
{
PyThrowBadEs(impObj()->setPointRef(ptType, ptRef.impObj()));
ptRef.forceKeepAlive(true); //never gets here on exception
}
PyDbPointRef PyDbDimAssoc::pointRef(int ptType) const
{
//uses a const CTOR, autoDelete = false
//const AcDbPointRef* pointRef(int ptType) const;
return PyDbPointRef(impObj()->pointRef(ptType));
}
Hopefully this won’t come back to bite me.
A, I’ll add test coverage,
B, I’ve made DisposableWrapper flags public to python so users can intercept before garbage collection