ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

transfer custom data

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
566 Views, 3 Replies

transfer custom data

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.

3 REPLIES 3
Message 2 of 4
Alexander.Rivilis
in reply to: Anonymous

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
Expert Elite Member

Message 3 of 4
Anonymous
in reply to: Alexander.Rivilis

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!!!

Message 4 of 4
Balaji_Ram
in reply to: Anonymous

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. 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report