Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it neccesary to always reset entity handles while loading dxf file? #65

Open
piaoger opened this issue Mar 24, 2024 · 0 comments
Open

Comments

@piaoger
Copy link
Contributor

piaoger commented Mar 24, 2024

While checking a dxf file, I found all handles in QCAD are different from this crate. It seems that all handles of block entities are renewed. I wonder if we can keep the handles while loading a file.

    pub(crate) fn add_block_no_handle_set(&mut self, mut block: Block) -> &Block {
        self.ensure_layer_is_present_for_block(&block);
        self.ensure_line_type_is_present_for_block(&block);
        self.ensure_block_record_is_present_for_block(&mut block);
        self.ensure_block_entity_handles_are_set(&mut block);
        self.__blocks.push(block);
        self.__blocks.last().unwrap()
    }

    fn ensure_block_entity_handles_are_set(&mut self, block: &mut Block) {
        for ent in &mut block.entities {
            ent.common.handle = self.next_handle();
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant