Opening other entities during dwgInFields

Opening other entities during dwgInFields

Anonymous
Not applicable
306 Views
3 Replies
Message 1 of 4

Opening other entities during dwgInFields

Anonymous
Not applicable
Hi, A custom entity has to perform its state computations based on other objects in the drawing. Everything works until a drawing is saved and loaded again. Then I try to open related objects and since they are not in a database yet, things get worse. Stepping in the debugger over the acdbOpenObject, the execution suddenly jumps at a breakpoint in some other dwgInFields. Since full call stack is missing from DBX DLLs, I cant say that for sure, but no exceptions have raised, it seems to be true. So does it mean that DBX runtime tries to load recursively the object being opened? Is this a documented behavior one can rely on? Since objects are loaded one-by-one, in dwgInFields I would like to process only the objects already have been loaded before the current object. I would expect to receive some error code trying to open not-yet-loaded object. Is that scenario possible in AutoCAD ? Regards, Aleksey Karyakin
0 Likes
307 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
For DWG files, we will load recursively. For DXF we only load sequentially. For DWG, if you try to open an object that hasn't yet been read in, the underlying open code will read that object in. I don't know of any way to tell if an object is not yet read in. "Aleksey Karyakin" wrote in message news:41eb9429_2@newsprd01... > Hi, > > A custom entity has to perform its state computations based on other objects > in the drawing. Everything works until a drawing is saved and loaded again. > Then I try to open related objects and since they are not in a database yet, > things get worse. > > Stepping in the debugger over the acdbOpenObject, the execution suddenly > jumps at a breakpoint in some other dwgInFields. Since full call stack is > missing from DBX DLLs, I cant say that for sure, but no exceptions have > raised, it seems to be true. So does it mean that DBX runtime tries to load > recursively the object being opened? Is this a documented behavior one can > rely on? > > Since objects are loaded one-by-one, in dwgInFields I would like to process > only the objects already have been loaded before the current object. I would > expect to receive some error code trying to open not-yet-loaded object. > > Is that scenario possible in AutoCAD ? > > Regards, > Aleksey Karyakin > >
0 Likes
Message 3 of 4

Anonymous
Not applicable
> I don't know of any way to tell if an object is not yet read in. I've never used it, but would AcDbObjectId::objectLeftOnDisk() be any help? -- Owen Wengerd President, ManuSoft ==> http://www.manusoft.com VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 4 of 4

Anonymous
Not applicable
That's only intended to be true when the object was intentionally left on disk rather then read in. "Owen Wengerd" wrote in message news:41ec3a69_2@newsprd01... > > I don't know of any way to tell if an object is not yet read in. > > I've never used it, but would AcDbObjectId::objectLeftOnDisk() be any > help? > -- > Owen Wengerd > President, ManuSoft ==> http://www.manusoft.com > VP Americas, CADLock, Inc. ==> http://www.cadlock.com > >
0 Likes