I want to create a custom entity named "ADSKStamp" derived from AcDbRasterImage, but when I load the arx, I got the error "Class ADSKStamp parent named ‘AcDbRasterImage’ not found" from autocad. I had already add the recommended code in init code, as below
virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
acrxDynamicLinker->loadModule(L"acismobj24.dbx", true);
ADSKStamp::rxInit();
acrxBuildClassHierarchy();
return (retCode) ;
}
What can I do to define a custom entity which can take some my own properties and can correctlly show a picture on the autocad drawing?
Solved! Go to Solution.
Solved by autodaug. Go to Solution.
Hi, that code looks correct. Can you verify that the acismobj24.dbx file is on the disk in the same location as acad.exe?
If you're using an older version of AutoCAD, the "24" in the filename may be replaced by "23" or something lower.
As a test, you could also try to force the imaging apps to be loaded by issuing the "imageAttach" command in AutoCAD. That should force loading of the dbx file and then it won't matter if your app loads it or not.
I can find acismobj24.dbx in the same location as acad.exe, after I use "imageAttach" command in AutoCAD, I can correctlly load arx, but how can I solve this problem in code?
Okay, so it sounds like your loadModule() call is either not being executed, or it is failing. Can you check to see if that call happens and does it return true? I suspect it is failing and returning false. Then during your call to acrxBuildClassHierarchy(), the parent class is not found, causing the error.
I don't know why the loadModule() would fail, if the file is there and AutoCAD is able to load it. If you're familiar with the ProcMon utility, you could use that to watch for FileSystem events involving the dbx's filename. I can guide you through that if you want to try it..
Thank you! I found the reason now, I should put "acrxDynamicLinker->loadModule(L"acismobj24.dbx", true);" before "AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt);", if I put it after the "AcRxArxApp::On_kInitAppMsg (pkt);",the error will reported to autocad before I load the dbx.
Well, I'm glad it's working for you, but I'm not sure you should have to change the order of calls like that.
One thing I just realized is that your code is for an enabler (dbx app), not an arx app. In that case, I think it should call the On_kInitAppMsg() method of the AcRxDbxApp class, not AcRxArxApp. Maybe give that a try?
Can't find what you're looking for? Ask the community or share your knowledge.