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

About continuous loading of local DXF files #126

Open
zhaomingxuan96 opened this issue Mar 15, 2024 · 3 comments
Open

About continuous loading of local DXF files #126

zhaomingxuan96 opened this issue Mar 15, 2024 · 3 comments

Comments

@zhaomingxuan96
Copy link

I’ve found that when opening a DXF file and then opening another new DXF file, the two will overlap in display. How can I make it so that when opening the second file, it clears the first one?

@yanzexuan1
Copy link
Collaborator

yanzexuan1 commented Mar 18, 2024

The viewer supports to load more than one DXF files. While it doesn't support unloading a DXF.

You can simply destroy the old DxfViewer instance, and new another one to load your new DXF file.

@wen089130
Copy link

请问有具体的代码实现吗?我这里不是很明白?

@yanzexuan1
Copy link
Collaborator

const viewer1 = new DxfViewer(cfg1);
viewer1.loadModel(modelCfg1);
...
viewer1.destroy();

const viewer2= new DxfViewer(cfg2);
viewer2.loadModel(modelCfg2);
...

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

3 participants