Skip to content
Discussion options

You must be logged in to vote

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:

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(

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@maslke
Comment options

Answer selected by maslke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant