- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
ACIS18 BinaryFile read problems
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-23-2008 02:15 AM - last edited on 07-23-2008 02:30 AM
Hi!
There is no option 'binary_read_format' in ACIS18, so I have tried to write/read without it with 'api_restore_entity_list_file' and 'api_save_entity_list_file' functions. I think that save_entity_list_file saves the file that looks like it is good, but api_restore_entity_list_file operation is unsuccessful. By looking at BinaryFile options I understood that the api_save... function working with these options:
big_end 0
need_swap 0
read_long_size -1
write_long_size 4,
but after 'api_restore_entity_list_file' call they are set to
big_end 0
need_swap 0
read_long_size 8
write_long_size 4
I've tried to set these BinaryFile options by myself (to 0,0,4,4 and 0,0,8,8 both on read and write) but this is not changed the whole image and 'api_restore_entity_list_file' returns unsuccess.
How does it mean if read_long_size is equal to -1?
How can I write and then read my file in ACIS18 with BinaryFile class?
Re: ACIS18 BinaryFile read problems
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-29-2008 08:59 AM
Hi Igorunius
The read and write formats are established by the read and write header methods respectively. This process relies on the ability to modify the read and write positions in the stream. I assume you have a custom FileInterface since you are using api_save/restore_entity_list_file. Have you implemented the set_mark and goto_mark methods correctly? Are you opening the streams correctly with "rb" and "wb"? Can you restore the file with the SchemeAIDE test application (or with api_restore_entity_list)?
Also, a read_long_size value of -1 simply means that it hasn't been set.
Best regards,
Jeff
Re: ACIS18 BinaryFile read problems
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-31-2008 12:45 AM - last edited on 07-31-2008 04:19 AM
Hi Jeff,
Yes, I can read .sab file by another program that can work with sab files, so, these binary files are saved correctly.
Both, set_mark and goto_mark returned 0 before. So I have tried to calculate count of readed bytes and seek into this position, it starts to working good.Thanks.
So I see that format definition algorithm is:
1 - reading header string "ACIS BinaryFile"
2 - then BinaryFile make attempt to read three LONG values
3 - if it can't read in one format, it seek current read position after last correct readed block and repeat (2) for next format
etc...
Re: ACIS18 BinaryFile read problems
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-17-2008 10:00 PM

