-
Hello everyone, In the source code, I noticed a comment stating: I'd like to ask if this function is now working as expected, or if it's still under development. Thank you in advance for your help! |
Beta Was this translation helpful? Give feedback.
Answered by
maslke
Apr 9, 2025
Replies: 1 comment 1 reply
-
I opened a DWG file that contains a predefined block named "1234". Then, I used code is here: void test_draw_block(Dwg_Data *dwg, Dwg_Object_BLOCK_HEADER *hdr) {
const dwg_point_3d pt1 = {12, 10, 0};
dwg_add_INSERT(hdr, &pt1, "1234", 1.0, 1.0, 1.0, 0.0);
}
int main() {
char *seed_file = "/home/xxx/Documents/seed.dwg";
Dwg_Data *dwg_data = (Dwg_Data*)malloc(sizeof(Dwg_Data));
memset(dwg_data, 0, sizeof(Dwg_Data));
dwg_read_file(seed_file, dwg_data);
int error = 0;
Dwg_Object_BLOCK_HEADER *hdr = dwg_get_block_header(dwg_data, &error);
// test_draw_line(hdr);
test_draw_block(dwg_data, hdr);
// test_draw_lwpolyline(hdr);
dwg_data->header.version = R_2000;
char *result_file="/home/xxx/Documents/result.dwg";
dwg_write_file(result_file, dwg_data);
dwg_free(dwg_data);
return 0;
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
maslke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I opened a DWG file that contains a predefined block named "1234". Then, I used
dwg_add_insert
to insert a reference to that block, but it didn’t work.code is here: