You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tested the latest release v0.13.3.7426, and found some features,am i right? I created and saved dwg file versions as 2000/2007/2018 with autocad 2000/autocad 2007/autocad 2018.
All versions decoding works well using dwg_read_file, except some objs can not be resolved.
All versions encoding can not work normal using dwg_new_Document and dwg_write_file. That mens i created(using dwg_new_Document) and saved(dwg_write_file) to local dwg file, and then open this file with autocad, the cad application reports dwg error that can't be opend with formation not compatible.
During the first two tests, i found that while i can get my dwg file with an empty dwg2000 as template using dwg_read_file and save as dwg2000 using dwg_write_file,but other dwg versions can't work.
I want to know if my testing was right?
Here is my testing code:
void
test_read ()
{
int error;
const char *file_path = "C:/Users/Administrator/Desktop/dwg/2000.dwg";
// created and saved by autocad2007
//const char *file_path = "C:/Users/Administrator/Desktop/dwg/2007.dwg";
// created and saved by autocad2018
//const char *file_path = "C:/Users/Administrator/Desktop/dwg/2018.dwg";
Read the docs. Encoding only works for versions <= r2000
Yes, you're right. But i can't create dwg file using dwg_new document and dwg_write_file from empty,if i did this, dwg file can't be opened by autocad with errors,can you give me an tips? Testing code above "test_write" function,thanks!
I have tested the latest release v0.13.3.7426, and found some features,am i right? I created and saved dwg file versions as 2000/2007/2018 with autocad 2000/autocad 2007/autocad 2018.
I want to know if my testing was right?
Here is my testing code:
void
test_read ()
{
int error;
const char *file_path = "C:/Users/Administrator/Desktop/dwg/2000.dwg";
// created and saved by autocad2007
//const char *file_path = "C:/Users/Administrator/Desktop/dwg/2007.dwg";
// created and saved by autocad2018
//const char *file_path = "C:/Users/Administrator/Desktop/dwg/2018.dwg";
Dwg_Data dwg_data;
memset (&dwg_data, 0, sizeof (Dwg_Data));
error = dwg_read_file (file_path, &dwg_data);
}
void
test_write ()
{
int error = 0;
const char *out_file_path = "C:/Users/Administrator/Desktop/dwg/r_2000_write.dwg";
Dwg_Data *dwg_data = dwg_new_Document (R_2000, 0, 2);
//const char *out_file_path = "C:/Users/Administrator/Desktop/dwg/r_2007_write.dwg";
//Dwg_Data *dwg_data = dwg_new_Document (R_2007, 0, 2);
//const char *out_file_path = "C:/Users/Administrator/Desktop/dwg/r_2018_write.dwg";
//Dwg_Data *dwg_data = dwg_new_Document (R_2018, 0, 2);
error = dwg_write_file (out_file_path, dwg_data);
free (dwg_data);
}
void
test_rewrite ()
{
int error;
const char *in_file_path = "C:/Users/Administrator/Desktop/dwg/2000.dwg";
const char *out_file_path = "C:/Users/Administrator/Desktop/dwg/r_2000_rewrite.dwg";
//const char *in_file_path = "C:/Users/Administrator/Desktop/dwg/2007.dwg";
//const char *out_file_path = "C:/Users/Administrator/Desktop/dwg/r_2007_rewrite.dwg";
//const char *in_file_path = "C:/Users/Administrator/Desktop/dwg/2018.dwg";
//const char *out_file_path = "C:/Users/Administrator/Desktop/dwg/r_2018_rewrite.dwg";
Dwg_Data dwg_data;
memset (&dwg_data, 0, sizeof (Dwg_Data));
error = dwg_read_file (in_file_path, &dwg_data);
error = dwg_write_file (out_file_path, &dwg_data);
}
int
main ()
{
// read test
test_read ();
// write test
// any version here has problems
test_write ();
// rewrite test
// only R_2000 can works well
test_rewrite ();
return 0;
}
The text was updated successfully, but these errors were encountered: