for example, the readString() and writeString() and transefer data of ACHAR in custom entity,but I want to transfer the data of myself struct or class.how can i do? because the data is somehow complex.the data maybe array.
Solved! Go to Solution.
Solved by Balaji_Ram. Go to Solution.
You can use pair of method readBChunk() and writeBChunk()
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
how to use the readBchunk() and writeBchunk(),can make an example? my class or struct contain AcGePoint3d and char * and double type. and i have 1000 more this struct to transfer in my custom entity;tks!!!
Hello,
For example, to write the BChunk from a "lpsrc" of "len" bytes :
ads_binary binbuf; binbuf.buf = (char*)malloc( len * sizeof(char)); binbuf.clen = len; memcpy(binbuf.buf, lpsrc, len); pFiler->writeBChunk(binbuf);
To read the saved BChunk :
ads_binary binbuf; pFiler->readBChunk(&binbuf); int len = binbuf.clen; void *lpsrc=binbuf.buf;
But, in general you should try avoid using it for datatypes that have other alternatives. As an example, you can use "AcDbDwgFiler::readPoint3d" and "AcDbDwgFiler::writePoint3d" for AcGePoint3d data. So, try finding the appropriate methods for the data types that you have and only resort to BChunk if there is no other way.
Can't find what you're looking for? Ask the community or share your knowledge.